[asterisk-users] Shortening Context code

Adrian Marsh Adrian.Marsh at ubiquisys.com
Fri Aug 31 05:39:01 CDT 2007


I'm not sure if a macro would work, as it's the exten => _0 bit that
we'd be looking at:

[macro_test}
Exten =>
_0.,1,ExecIF($["${RECORDOUTBOUND}"="TRUE"],Monitor,wav|${TIMESTAMP}-${CA
LLERID(num)}-${EXTEN}-${UNIQUEID}.WAV)
exten =>
_0.,2,ExecIF($[${LEN(${CALLERID(num)})}=4],Set,CALLERID(number)=${PSTN_G
LOBAL}${CALLERID(num):-2})
exten => _0.,3,Dial(${TRUNK}/${EXTEN},,W) exten => _0.,4,Congestion
exten => _0.,5,Goto(outgoing-zen-out-0,${EXTEN},1)
exten => _0.,103,Busy
exten => _0.,104,Goto(outgoing-zen-out-0,${EXTEN},1)

to also work like:

Exten =>
_**777.,1,ExecIF($["${RECORDOUTBOUND}"="TRUE"],Monitor,wav|${TIMESTAMP}-
${CA
LLERID(num)}-${EXTEN}-${UNIQUEID}.WAV)
exten =>
_**777.,2,ExecIF($[${LEN(${CALLERID(num)})}=4],Set,CALLERID(number)=${PS
TN_G
LOBAL}${CALLERID(num):-2})
exten => _**777.,3,Dial(${TRUNK}/${EXTEN},,W) exten => _0.,4,Congestion
exten => _**777.,5,Goto(outgoing-zen-out-0,${EXTEN},1)
exten => _**777.,103,Busy
exten => _**777.,104,Goto(outgoing-zen-out-0,${EXTEN},1)

So I can't see how a macro would work as I can't use variables in the
"exten => " part..



More information about the asterisk-users mailing list