[Asterisk-Users] "Context Picker" for interception and redirection
Jose Solares
jsolares.lists at gmail.com
Wed Dec 14 19:02:51 MST 2005
You could also use macros, looks a bit cleaner perhaps.
exten => _9NXXNXXXXX,1,Macro(local-outbound-test,${EXTEN:1})
exten => _91NXXNXXXXX,1,Macro(cheapprovider-outbound,${EXTEN:1})
exten => _8., 1, Macro( ioc, ${EXTEN:1})
[macro-local-outbound-test]
exten => s,1,Dial(${LOCALIAXOUT}/${ARG1},,r)
exten => s,2,Playback(last-error-was)
exten => s,3,SayDigits(${CAUSECODE})
exten => s,4,Playback(tt-somethingwrong)
exten => s,5,Hangup
exten => s,102,NoOp(seq 102 check)
[macro-cheapprovider-outbound]
...
[macro-ioc]
...
On 12/14/05, Jason Lixfeld <jason+lists.asterisk at lixfeld.ca> wrote:
>
> Got it working.. wow.. didn't think it would be this easy:
>
> [test]
> ; Test SIP user's context
> include => contextpicker
>
> [contextpicker]
> exten => _9NXXNXXXXXX,1,Set(LOCALEXT=${EXTEN:1})
> exten => _9NXXNXXXXXX,2,GoTo(local-outbound-test,localout,1)
> exten => _9NXXNXXXXXX,102,NoOp(seq 102 check)
> exten => _91NXXNXXXXXX,1,Set(LDEXT=${EXTEN:1})
> exten => _91NXXNXXXXXX,2,GoTo(cheapldprovider-outbound-test,ldout,1)
> exten => _91NXXNXXXXXX,102,NoOp(seq 102 check)
> exten => _8.,1,Set(INOCEXT={$EXTEN:1})
> exten => _8.,2,GoTo(inoc-dba,s,1)
> exten => _8.,102,NoOp(seq 102 check)
>
> [local-outbound-test]
> exten => localout,1,Dial(${LOCALIAXOUT}/${LOCALEXT},,r)
> exten => localout,2,Playback(last-error-was)
> exten => localout,3,SayDigits(${CAUSECODE})
> exten => localout,4,Playback(tt-somethingwrong)
> exten => localout,5,Hangup
> exten => localout,102,NoOp(seq 102 check)
>
> [cheapldprovider-outbound-test]
> exten => ldout,1,Dial(${LDIAXOUT}/${LDEXT},,r)
> exten => ldout,2,Playback(last-error-was)
> exten => ldout,3,SayDigits(${CAUSECODE})
> exten => ldout,4,Playback(tt-somethingwrong)
> exten => ldout,5,Hangup
> exten => ldout,102,NoOp(seq 102 check)
>
>
> On 14-Dec-05, at 5:56 PM, Jason Lixfeld wrote:
>
> > Going try my best to explain this and hopefully it will make sense:
> >
> > We're trying to come up with something that we can only refer to as
> > a "context picker". The idea is that if someone dials 98625551212,
> > the "context picker" will direct the call to the proper context
> > based on the dialing prefix, in this case "9". The context picker
> > would then re-write the extension and then Goto the proper context
> > based on the prefix. The context would need to miraculously read a
> > variable set by the context picker to match the dialed number
> > pattern and execute the proper Dial. The thing I can't seem to
> > figure out is how to get the context to read this variable set by
> > the context picker as a dialstring. For example (not syntactically
> > correct, I know):
> >
> > [contextpicker]
> > exten => _9NXXNXXXXXX,1,SetVar(L-EXT=${EXTEN:1})
> > exten => _9NXXNXXXXXX,2,GoTo(localoutbound,${L-EXT})
> > exten => _91NXXNXXXXXX,1,SetVar(LD-EXT=${EXTEN:1})
> > exten => _91NXXNXXXXXX,2,GoTo(ldoutbound,${LD-EXT})
> > exten => _8.,1,SetVar(INOC-EXT=${EXTEN:1})
> > exten => _8.,2,GoTo(inoc-dba,${INOC-EXT})
> >
> >
> > [localoutbound]
> > exten => ${L-EXT},1,Dial(SIP/localdump)
> >
> > [ldoutbound]
> > exten => ${L-EXT},1,Dial(SIP/lddump)
> >
> > [inoc-dba]
> > exten => ${INOC-EXT},1,Dial(SIP/inocdump)
> >
> > Does this make sense? Is there a better way to achieve this?
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > Asterisk-Users mailing list
> > To UNSUBSCRIBE or update options visit:
> > http://lists.digium.com/mailman/listinfo/asterisk-users
> >
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051214/688683a3/attachment.htm
More information about the asterisk-users
mailing list