[Asterisk-Users] Running a Marco from the dial command

Chris listmail at odisok.net
Fri Apr 8 17:19:05 MST 2005


    I am trying to run a macro from the options on the dial command.     I want to play a sound on an active call and repeat it.    I figured I needed to use a marco, but the macro never activates.     The call is placed and connected, but I never see the macro run.      I invoke the macro by dialing *8.    I have AMP installed.  Can anyone help me on this one?  Here is what I put in the Extensions.conf.

[macro-dialout-trunk-rec]
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,SetGroup(OUT_${ARG1})
exten => s,7,CheckGroup(${OUTMAXCHANS_${ARG1}})
; if we've used up the max channels, continue at 108 (n+101)
exten => s,8,SetVar(DIAL_NUMBER=${ARG2})
exten => s,9,SetVar(DIAL_TRUNK=${ARG1})
exten => s,10,AGI(fixlocalprefix) ; this sets DIAL_NUMBER to the proper dial string for this trunk
exten => s,11,SetVar(CALLFILENAME=${EXTEN:1}-${TIMESTAMP})
exten => s,12,NoOp(${ARG1})
exten => s,13,Monitor(wav,${CALLFILENAME},m)
exten => s,14,Dial(${OUT_${ARG1}}/${OUTPREFIX_${ARG1}}${DIAL_NUMBER},60,M(voicerec^${DIAL_NUMBER}))
; if dial fails (ie, all channels are busy), continue at 112 (n+101)

; we should only get here if the call was successful (?)
;exten => s,9,Congestion

; exit points for macro
exten => s,108,NoOp(max channels used up)
exten => s,112,NoOp(dial failed)

[marco-voicerec]
exten => s,1,noop(${ARG1})
exten => s,2,Background(custom/recordwarn)


More information about the asterisk-users mailing list