Steve Langstaff
2007-Nov-29 17:31 UTC
[asterisk-users] SLA: Handling of errors in outgoing call
Hi All. I've been experimenting with SLA on Asterisk 1.4.13 (patched up to 1.4.14). I am using a SIP channel for my "trunk" line. On the whole things are good, but I have noticed that if I misdial an outgoing call, i.e. I get 404 "Not Found" in the SIP trace, then the trunk line just drops, rather than presenting an error tone or message to the user. ======================= Here is my sip.conf (cleaned to protect the innocent): register => 5000:password:username at vsp5000/5000 [vsp5000] type=peer secret=password username=username host=vsp.ip.address fromuser=5000 fromdomain=vsp.domain canreinvite=no context=line-in insecure=very ======================= Here is my sla.conf: [line1] type=trunk device=Local/disa at line1_outbound [station](!) ; When there are a lot of stations that are configured the same way, ; it is convenient to use a configuration template like this so that ; the common settings stay in one place. type=station autocontext=default trunk=line1 trunk=line2 ;trunk=line3 ;trunk=line4 [station1](station) device=SIP/station1 [station2](station) device=SIP/station2 ======================= Here is my extensions.conf: [macro-call-sla] ; ${ARG1} - line name exten => s,1,SLATrunk(${ARG1}) exten => s,2,Hangup [line1_outbound] exten => disa,1,Disa(no-password|line1_outbound) exten => _XXXX,1,Dial(SIP/${EXTEN}@vsp5000) exten => _XXXX,2,Hangup [line-in] exten => 5000,1,Macro(call-sla,line1) ======================= So to summarise: if I seize the line and dial a number known at vsp5000 then I get ringing etc - good. if I seize the line and dial a number unknown at vsp5000 then the call drops silently - not good. Any ideas? __________ Steve Langstaff
Russell Bryant
2007-Dec-01 00:08 UTC
[asterisk-users] SLA: Handling of errors in outgoing call
Steve Langstaff wrote:> [line1_outbound] > exten => disa,1,Disa(no-password|line1_outbound) > exten => _XXXX,1,Dial(SIP/${EXTEN}@vsp5000) > exten => _XXXX,2,Hangup> So to summarise: > if I seize the line and dial a number known at vsp5000 then I > get ringing etc - good. > if I seize the line and dial a number unknown at vsp5000 then > the call drops silently - not good.Your issue is actually in the [line1_outbound] context that I have quoted above. Here is what happens: As far as Disa() is concerned, any 4 digit number is a valid extension. Once you dial something (whether is valid at the other end or not), the call goes on and executes Dial(). However, since the number you have dialed is not valid, Dial() immediately returns and then Hangup is executed. That is when the call is dropping. So, I can think of a few different ways to solve this issue. The first couple involve using an IAX2 or DUNDi switch statement in the line1_outbound context. That would allow Asterisk to query the remote server as to what extensions are valid. However, I won't get into the details of how that is configured right now ... The other alternative is to solve it in the dialplan, with something like this: [line1_outbound] exten => disa,1,Disa(no-password|line1_outbound) exten => _XXXX,1,Dial(SIP/${EXTEN}@vsp5000) exten => _XXXX,n,Congestion exten => _XXXX,n,Wait(10) ; Give Congestion for 10 seconds exten => _XXXX,n,Hangup You could improve this even further by checking the DIALSTATUS and playing different tones, or just hanging up, accordingly. I hope this helps, -- Russell Bryant Senior Software Engineer Open Source Team Lead Digium, Inc.