[Asterisk-Users] Busy detect on pri channel?

Thilo Salmon salmon at netzquadrat.de
Mon Jul 28 09:21:27 MST 2003


> Method 2 is my favorite.  Note that this would not be a difficult 
> feature to add, but it would be tedious since every type of channel 
> would need to have every Dial exit area set the $RESULTCODE value. 
> Perhaps I'll add that to the feature request list when I return from 
> my trip...

John,

I went ahead and did a first step. This patch sets $RESULTCODE to the
hangup cause as contained in the DISCONNECT message, when dialing out on
a single pri channel and dial is called with the option 'R'. On 'normal
call clearing' (cause 16) Dial still hangs up. Nevertheless, the
following dialplan works for me:

[testing]
exten => 58005900,1,Answer
exten => 58005900,2,Dial(Zap/g8/12341234|20|R) 
exten => 58005900,3,Goto(${RESULTCODE}) 
exten => 58005900,17,Busy 
exten => 58005900,21,Congestion 
exten => 58005900,31,Congestion 
exten => 58005900,42,Congestion 

If you did the same for SIP we might be able to throw together an
application to generalize messages based on a config file as you
suggested. Then we could perhaps do something like

[context1]
exten => 58005900,1,Dial(Zap/...|20|R)
exten => 58005900,2,ParseCause(Zap,${RESULTCODE},$GENERALCAUSE)
exten => 58005900,3,Goto(errorhandling,s,${GENERALCAUSE})

[context2]
exten => 58005900,1,Dial(SIP/...|20|R)
exten => 58005900,2,ParseCause(SIP,${RESULTCODE},$GENERALCAUSE)
exten => 58005900,3,Goto(errorhandling,s,${GENERALCAUSE})

[errorhandling]
exten => s,1,Busy
exten => s,2,Congestion
exten => s,3,Hangup

and we're almost there.

What do you think?

Thilo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-resultcode.diff
Type: text/x-patch
Size: 4925 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20030728/4620d341/patch-resultcode.bin


More information about the asterisk-users mailing list