Skip to main content

Trunk Context

Posted by Macrolan on Wed, 03/08/2017

Hi there

We are running a trial of thirdlane and my company is really enjoying it so far its solving all our issue

we would like to know how to add this "Context" for trunks

[custom-from-onlinevoip]
exten => s,1,Set(rgn=${CALLERID(rdnis)})
exten => s,n,Noop(custom-from-onlinevoip: call from ${CALLERID(all)} to ${EXTEN} with RGN ${rgn}) exten => s,n,GotoIf($["x${rgn}" != "x"]?from-trunk,${rgn},1)
exten => s,n,Goto(from-trunk,s,1) include => from-trunk


Submitted by Macrolan on Wed, 03/08/2017 Permalink

the reason i ask the above our provider has a voipswitch where by

the Number E,I DDI will be 0878288818 and they forwards that to a telephone line : 5780187

the telephone line : 5780187 is the sip account we register

On thirdlane i can add the DDI being 5780187 they all my numbers will come in if i point it to that telephone line 5780187

but if i was my number 0878288818 to go to ext 100 and 0878288817 to go to ext 102 this wont work

because this is how its coming in

-- Executing [5780187@from-outside:1] Wait("SIP/1971795-0000018b", "1") in new stack
-- Executing [5780187@from-outside:2] Set("SIP/1971795-0000018b", "CDR(did)=5780187") in new stack
-- Executing [5780187@from-outside:3] ExecIf("SIP/1971795-0000018b", "0?Gosub(from-outside-fixinbound,5780187,1)") in new sta
-- Executing [5780187@from-outside:4] Set("SIP/1971795-0000018b", "__INCOMINGCLI=0878205549") in new stack
-- Executing [5780187@from-outside:5] Goto("SIP/1971795-0000018b", "from-outside-redir,5780187,1") in new stack

so we have used a work around like this method before and it worked
[custom-from-onlinevoip]
exten => s,1,Set(rgn=${CALLERID(rdnis)})
exten => s,n,Noop(custom-from-onlinevoip: call from ${CALLERID(all)} to ${EXTEN} with RGN ${rgn})
exten => s,n,GotoIf($["x${rgn}" != "x"]?from-trunk,${rgn},1)
exten => s,n,Goto(from-trunk,s,1) include => from-trunk