[asterisk-users] macro-dialout without specifying trunk

Dan Casey dcasey at debtresolve.com
Tue Aug 15 16:04:38 MST 2006


I am trying to have a SIP extension that will dial an outside phone
number (ie: cell phone) using a zap channel.
I am using the following hack, which doesn't technically works, but not
nicely.  What i want to do is have it pick an available trunk from zap1
to zap20.
I have tried using "dialout,s,number" and also "dialout,g1,number"  i
just keep getting all circuits busy.  (I have posted my zapata.conf below).


I can do it if I specify the specific trunk.  Here is my extension:
exten => 299,1,Macro(dialout-return,1,1914426nnnn)
exten => 299,2,Macro(dialout-return,2,1914426nnnn)
exten => 299,3,Macro(dialout-return,5,1914304nnnn)
exten => 299,4,hangup

; dialout-return. Like dialout but doesn't go to outisbusy.
[macro-dialout-return]
exten => s,1,GotoIf($[foo${ECID${CALLERIDNUM}} = foo]?4)        ;check
for CID override for exten
exten => s,2,SetCallerID(${ECID${CALLERIDNUM}})
exten => s,3,Goto(6)
exten => s,4,GotoIf($[foo${OUTCID_${ARG1}} = foo]?6)            ;check
for CID override for trunk
exten => s,5,SetCallerID(${OUTCID_${ARG1}})
exten => s,6,SetVar(length=${LEN(${DIAL_OUT_${ARG1}})})
exten => s,7,Dial(${OUT_${ARG1}}/${ARG2:${length}})




zapata.conf

[trunkgroups]

[channels]

language=en
context=from-pstn
signalling=pri_cpe
switchtype=national

rxwink=300              ; Atlas seems to use long (250ms) winks
callerid=asreceived

usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
echotraining=400
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no

faxdetect=incoming

channel => 1-7





More information about the asterisk-users mailing list