Hi All,
I’m trying to figure out how to best make use of DID routing using the inbound routes feature.
Currently my VOIP provider (callcentric) passes information on the DID called in the SIP_HEADER(TO) variable. The information is passes as:
<sip:[email protected]>
I’d like to parse this SIP_HEADER(TO) to get the DID from it and set an appropriate variable so that my incoming route can route it so a particular destination.
I’ve got several DIDs that I would like to route differently.
Currently I can do this in extensions_custom.conf by setting up the following context:
exten => s,1,Set(Var_TO=${SIP_HEADER(TO)})
exten => s,n,GotoIf($["${Var_TO}" = "<sip:[email protected]>"]?from-did-direct,111,1)
exten => s,n,GotoIf($["${Var_TO}" = "<sip:[email protected]>"]?app-daynight,0,1)
exten => s,n,GotoIf($["${Var_TO}" = "<sip:[email protected]>"]?custom-changednum,s,1)
exten => s,n,GotoIf($["${Var_TO}" = "<sip:[email protected]>"]?app-daynight,0,1)
exten => s,n,GotoIf($["${Var_TO}" = "<sip:[email protected]>"]?from-did-direct,120,1)
exten => s,n,Goto(app-daynight,0,1)
exten => h,n,Macro(hangupcall)
However, I’d like to get rid of as much custom context as possible and let FreePBX handle the routing.
Any ideas what variable I can set to the parsed DID number PRIOR to the call hitting the inbound routes?
Thanks for any suggestions.
jimbo