<div class="gmail_quote">On Tue, Dec 21, 2010 at 6:59 PM, Stephen Reese <span dir="ltr"><<a href="mailto:rsreese@gmail.com">rsreese@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Tue, Dec 21, 2010 at 7:58 PM, Stephen Reese <<a href="mailto:rsreese@gmail.com">rsreese@gmail.com</a>> wrote:<br>
> Is there a way to include:<br>
><br>
> _NXXNXXXXXX<br>
> _NXXXXXX<br>
> _011.<br>
> _911<br>
><br>
> into my current plan:<br>
><br>
<br>
</div>Sorry, here's the rest.<br>
<br>
exten => _1NXXNXXXXXX,1,Set(Outgoing=${CUT(CHANNEL,/,2)})<br>
exten => _1NXXNXXXXXX,n,Set(Outgoing=${CUT(Outgoing,-,1)})<br>
exten => _1NXXNXXXXXX,n,GotoIf($["${Outgoing}" = "201"]?20:10)<br>
exten => _1NXXNXXXXXX,10,Set(CALLERID(all)=${EXTERNAL_CALLERID})<br>
exten => _1NXXNXXXXXX,n,Dial(SIP/${EXTEN}@vitel-outbound)<br>
exten => _1NXXNXXXXXX,n,Goto(h,1)<br>
exten => _1NXXNXXXXXX,20,Set(CALLERID(all)=${EXTERNAL_CALLERID})<br>
exten => _1NXXNXXXXXX,n,Dial(SIP/${EXTEN}@vitel-outbound2)<br>
exten => _1NXXNXXXXXX,n,Goto(h,1)<br>
<br></blockquote></div><br>Why not make a Macro (or GoSub) to handle this block of code, and then your outbound dial lines are just one line calling the Macro? Saves a lot of repeating blocks of code. Something like this (not tested):<br>
<br>[macro-OutboundDial]<br>; ${ARG1} = CHANNEL<br>; ${ARG2} = EXTERNAL_CALLERID<br>exten => s,1,Set(Outgoing=${CUT(${ARG1},/,2)})<br>exten => s,n,Set(Outgoing=${CUT(Outgoing,-,1)})<br>exten => s,n,GotoIf($["${Outgoing}" = "201"]?outbound2:outbound1)<br>
exten => s,n(outbound1),Set(CALLERID(all)=${ARG2})<br>exten => s,n,Dial(SIP/${MACRO_EXTEN}@vitel-outbound)<br>exten => s,n,Goto(h,1)<br>exten => s,n(outbound2),Set(CALLERID(all)=${ARG2})<br>exten => s,n,Dial(SIP/${MACRO_EXTEN}@vitel-outbound2)<br>
exten => s,n,Goto(h,1)<br><br>[outbound-context]<br><br>exten => _NXXNXXXXXX,1,Macro(OutboundDial,${CHANNEL},${EXTERNAL_CALLERID})<br>exten => _NXXXXXX,1,Macro(OutboundDial,${CHANNEL},${EXTERNAL_CALLERID})<br>exten => _011.,1,Macro(OutboundDial,${CHANNEL},${EXTERNAL_CALLERID})<br>
exten => _911,1,Macro(OutboundDial,${CHANNEL},${EXTERNAL_CALLERID})<br><br clear="all"><br>-- <br>Thanks,<br>--Warren Selby, dCAP<br><a href="http://www.selbytech.com" target="_blank">http://www.selbytech.com</a><br>