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