[Asterisk-Users] "Context Picker" for interception and redirection

Jason Lixfeld jason+lists.asterisk at lixfeld.ca
Wed Dec 14 15:56:45 MST 2005


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?



More information about the asterisk-users mailing list