Skip to main content

Urgent Guidance please

Posted by Macrolan on Thu, 03/09/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

he 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


Submitted by thirdlane on Fri, 03/10/2017 Permalink

You can specify context on the trunk screen (available in recent versions) and include your code in /etc/asterisk/user_extensions.include file. Any custom code can go in that file - it is preserved during software updates.

Submitted by Macrolan on Fri, 03/10/2017 Permalink

Hi Thank you for the response iv added the code as to the path you provided me

/etc/asterisk/user_extensions.include

with script===========
[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-outside,${rgn},1)
exten => s,n,Goto(from-outside,s,1)

#include => from-outside
=======================================

However when i go into the GUI and click on trunks --> Create SIP Trunk,

on the options ( CONTEXT ) it provides me with a drop down list with

from-outside
from-inside-bantrybay
from-inside-unrestricted
from-instide-restricted
=============================================

I need to get this to work, as our first test and then IP TRUNK AUTHENTICATION before we purchase

Waiting on your reply

Regards
Jason Menge
Macrolan

Submitted by thirdlane on Fri, 03/10/2017 Permalink

Hi Jason,

This was implemented in 8.0.2.1 - are you running an earlier version?

My suggestion is to update when we have a new release next week.