You could also use macros, looks a bit cleaner perhaps.<br><br>exten =&gt; _9NXXNXXXXX,1,Macro(local-outbound-test,${EXTEN:1})<br>exten =&gt; _91NXXNXXXXX,1,Macro(cheapprovider-outbound,${EXTEN:1})<br>exten =&gt; _8., 1, Macro( ioc, ${EXTEN:1})
<br><br>[macro-local-outbound-test]<br>exten =&gt; s,1,Dial(${LOCALIAXOUT}/${ARG1},,r)<br>exten =&gt; s,2,Playback(last-error-was)<br><div>exten =&gt; s,3,SayDigits(${CAUSECODE})<br>exten =&gt; s,4,Playback(tt-somethingwrong)
<br>exten =&gt; s,5,Hangup<br>exten =&gt; s,102,NoOp(seq 102 check)</div><br>[macro-cheapprovider-outbound]<br>...<br><br>[macro-ioc]<br>...<br><br><div><span class="gmail_quote">On 12/14/05, <b class="gmail_sendername">Jason Lixfeld
</b> &lt;<a href="mailto:jason+lists.asterisk@lixfeld.ca">jason+lists.asterisk@lixfeld.ca</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Got it working.. wow..&nbsp;&nbsp;didn't think it would be this easy:<br><br>[test]<br>; Test SIP user's context<br>include =&gt; contextpicker<br><br>[contextpicker]<br>exten =&gt; _9NXXNXXXXXX,1,Set(LOCALEXT=${EXTEN:1})<br>exten =&gt; _9NXXNXXXXXX,2,GoTo(local-outbound-test,localout,1)
<br>exten =&gt; _9NXXNXXXXXX,102,NoOp(seq 102 check)<br>exten =&gt; _91NXXNXXXXXX,1,Set(LDEXT=${EXTEN:1})<br>exten =&gt; _91NXXNXXXXXX,2,GoTo(cheapldprovider-outbound-test,ldout,1)<br>exten =&gt; _91NXXNXXXXXX,102,NoOp(seq 102 check)
<br>exten =&gt; _8.,1,Set(INOCEXT={$EXTEN:1})<br>exten =&gt; _8.,2,GoTo(inoc-dba,s,1)<br>exten =&gt; _8.,102,NoOp(seq 102 check)<br><br>[local-outbound-test]<br>exten =&gt; localout,1,Dial(${LOCALIAXOUT}/${LOCALEXT},,r)<br>
exten =&gt; localout,2,Playback(last-error-was)<br>exten =&gt; localout,3,SayDigits(${CAUSECODE})<br>exten =&gt; localout,4,Playback(tt-somethingwrong)<br>exten =&gt; localout,5,Hangup<br>exten =&gt; localout,102,NoOp(seq 102 check)
<br><br>[cheapldprovider-outbound-test]<br>exten =&gt; ldout,1,Dial(${LDIAXOUT}/${LDEXT},,r)<br>exten =&gt; ldout,2,Playback(last-error-was)<br>exten =&gt; ldout,3,SayDigits(${CAUSECODE})<br>exten =&gt; ldout,4,Playback(tt-somethingwrong)
<br>exten =&gt; ldout,5,Hangup<br>exten =&gt; ldout,102,NoOp(seq 102 check)<br><br><br>On 14-Dec-05, at 5:56 PM, Jason Lixfeld wrote:<br><br>&gt; Going try my best to explain this and hopefully it will make sense:<br>&gt;
<br>&gt; We're trying to come up with something that we can only refer to as<br>&gt; a &quot;context picker&quot;.&nbsp;&nbsp;The idea is that if someone dials 98625551212,<br>&gt; the &quot;context picker&quot; will direct the call to the proper context
<br>&gt; based on the dialing prefix, in this case &quot;9&quot;.&nbsp;&nbsp;The context picker<br>&gt; would then re-write the extension and then Goto the proper context<br>&gt; based on the prefix.&nbsp;&nbsp;The context would need to miraculously read a
<br>&gt; variable set by the context picker to match the dialed number<br>&gt; pattern and execute the proper Dial.&nbsp;&nbsp;The thing I can't seem to<br>&gt; figure out is how to get the context to read this variable set by<br>&gt; the context picker as a dialstring.&nbsp;&nbsp;For example (not syntactically
<br>&gt; correct, I know):<br>&gt;<br>&gt; [contextpicker]<br>&gt; exten =&gt; _9NXXNXXXXXX,1,SetVar(L-EXT=${EXTEN:1})<br>&gt; exten =&gt; _9NXXNXXXXXX,2,GoTo(localoutbound,${L-EXT})<br>&gt; exten =&gt; _91NXXNXXXXXX,1,SetVar(LD-EXT=${EXTEN:1})
<br>&gt; exten =&gt; _91NXXNXXXXXX,2,GoTo(ldoutbound,${LD-EXT})<br>&gt; exten =&gt; _8.,1,SetVar(INOC-EXT=${EXTEN:1})<br>&gt; exten =&gt; _8.,2,GoTo(inoc-dba,${INOC-EXT})<br>&gt;<br>&gt;<br>&gt; [localoutbound]<br>&gt; exten =&gt; ${L-EXT},1,Dial(SIP/localdump)
<br>&gt;<br>&gt; [ldoutbound]<br>&gt; exten =&gt; ${L-EXT},1,Dial(SIP/lddump)<br>&gt;<br>&gt; [inoc-dba]<br>&gt; exten =&gt; ${INOC-EXT},1,Dial(SIP/inocdump)<br>&gt;<br>&gt; Does this make sense?&nbsp;&nbsp;Is there a better way to achieve this?
<br>&gt; _______________________________________________<br>&gt; --Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a> --<br>&gt;<br>&gt; Asterisk-Users mailing list<br>&gt; To UNSUBSCRIBE or update options visit:
<br>&gt;&nbsp;&nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>&gt;<br><br>_______________________________________________<br>--Bandwidth and Colocation provided by 
<a href="http://Easynews.com">Easynews.com</a> --<br><br>Asterisk-Users mailing list<br>To UNSUBSCRIBE or update options visit:<br>&nbsp;&nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users
</a><br></blockquote></div><br>