On Wed, Dec 22, 2010 at 10:12 PM, Stephen Reese <[email protected]> wrote:
> Thanks Warren, that's what I'm looking to do.
>
> First question is where did ${MACRO_EXTEN} come from, I assumed
> ${EXTEN} is a built in variable?
>
> Secondly, where would the 1 and/or area-code need to be placed? Could
> an additional argument be used to specify the prefix, i.e. a third
> variable be specified in the outbond-context to implement the
> OutboundDial macro, or is the MACRO_EXTEN suppose to be an
> implementation of this?
>
> exten => s,n,Dial(SIP/{$arg3}${macro_ext...@vitel-outbound2)
>
> As Jeroen mentioned previously a goto may be used, would this help,
> seems similar to what I am trying to accomplish.
>
> exten => _NXXNXXXXXX,1,Goto(1${EXTEN},1)
> exten => _NXXXXXX,1,Goto(1555${EXTEN},1)
>
>
>
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
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users