[asterisk-users] Shortening Context code

Anthony Messina amessina at messinet.com
Fri Aug 31 04:51:01 CDT 2007


On Friday 31 August 2007 04:34:42 am Adrian Marsh wrote:
> If I had a large block of code, eg:
>
> [outgoing-pstn-gradwell]
> ; the caller ID convertion assumes that the last two digits of the
> callers id
> ; are mapped to the last two digits of the PSTN number.
> 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)
>
> (or larger)
>
> But I wanted to use the same logic for a different EXTEN,  eg (_**777),
> instead of duplicating the entire code, would there be a way to re-use
> the same block without copy/paste?

would a macro be good for this?  what are you trying to accomplish? are people 
on internal extensions trying to dial pstn numbers?

-- 
Anthony -  http://messinet.com - http://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20070831/a48468c8/attachment.pgp 


More information about the asterisk-users mailing list