[asterisk-users] Simple dial plan inquiry

Noah Miller noahisaacmiller at gmail.com
Mon Apr 30 12:25:35 MST 2007


Hi Steve -

> [macro-dialout];
> arg1 = callerid number;
> arg2 = phone numberl
> exten => s,1,Set(CALLERID(number)=${ARG1})
> exten => s,2,GotoIf($[${LEN(${ARG2})} = 10]?3:4)
> exten => s,3,Set(ARG2=1${ARG2})
> exten => s,4,Dial(${TRUNK}/${ARG2},,m)
> exten => s,5,Congestion()
> exten => s,105,Busy()
>
> This macro overrides one SIP endpoint which I use for personal usage and
> do not wish to contain our default CID which is passed through arg1. Is
> there anyway I can combine GotoIf/Goto to set it otherwise? I was
> thinking in terms of pseudo code to do something similar to the following:

Looks like it should work.  Does it?  Dialplan logic is fairly terse.
I don't think you'll be able to clean it up much more than that.  If
you're looking for something that looks prettier, you could always use
AEL/AEL2.  Of course, in the end AEL code will compile down to
Dialplan code.

- Noah


More information about the asterisk-users mailing list