[asterisk-users] Simplifying dial-plan

Stephen Reese rsreese at gmail.com
Thu Dec 23 14:03:11 UTC 2010


> To answer your first question - ${MACRO_EXTEN} is a macro-specific
> variable.  It's the ${EXTEN} that called the macro, since using ${EXTEN}
> inside a Macro would just give you a value of "s".
>
> As for your second question, that's pretty easy to do.  If every outbound
> call needs to be formatted in the format 1NXXNXXXXXX, you would do this
> (again, untested, but should be good along with the macro I gave you
> earlier):
>
> [globals]
> DEFAULT_AREA_CODE=555 ; swap with your default area code
>
> [outbound-context]
>
> exten => _1NXXNXXXXXX,1,Macro(OutboundDial,${CHANNEL},${EXTERNAL_CALLERID})
> exten => _NXXNXXXXXX,1,Goto(outbound-context,1${EXTEN},1)
> exten => _NXXXXXX,1,Goto(outbound-context,1${DEFAULT_AREA_CODE}${EXTEN},1)
> exten => _011.,1,Macro(OutboundDial,${CHANNEL},${EXTERNAL_CALLERID})
> exten => 911,1,Macro(OutboundDial,${CHANNEL},${EXTERNAL_CALLERID})
>
>
> --
> Thanks,
> --Warren Selby, dCAP
> http://www.selbytech.com

Thanks again Warren, that works quite well!



More information about the asterisk-users mailing list