Skip to main content

Pass the DID / DNIS to a SIP extension

Posted by trinicom on Tue, 02/14/2017

Hey guys,

trying to send the DID that was called to an extension in Thirdlane.

So if someone calls 7138385555 and I used in bound routes to send the call to an extension
I need to send that # 7138385555 to the extension with the normal caller ID.

any idles?

thanks

Keith


Submitted by thirdlane on Tue, 02/14/2017 Permalink

The dialed number is available in ${DIALED_PUBLIC_NUMBER} variable and you could use it in a script that calls the extension., How do you want this be presented to the callee?

Submitted by trinicom on Tue, 02/14/2017 Permalink

tried this, I now see the correct DID in the dial string, but no worky
Any ideal on how I need to pass this along correctly?

exten => s,1,Set(CALLERID(name)=${ARG2}${CALLERID(name)})
exten => s,2,Dial(SIP/${ARG1}${TL_DASH}${tenant} /${DIALED_PUBLIC_NUMBER})
exten => s,3,Hangup
I get
-- Executing [s@macro-tl-send-fromDID-to-ext:1] Set("IAX2/CustomerTenant-15826", "CALLERID(name)=TRINICOM COMMUN") in new stack
-- Executing [s@macro-tl-send-fromDID-to-ext:2] Dial("IAX2/CustomerTenant-15826", "SIP/51-CustomerTenant /7138385555") in new stack
== Using SIP RTP CoS mark 5
[Feb 14 14:08:56] WARNING[22469]: chan_sip.c:5331 create_addr: No such host: 51-CustomerTenant
[Feb 14 14:08:56] WARNING[22469]: app_dial.c:1747 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Unknown)

Submitted by trinicom on Tue, 02/14/2017 Permalink

I got it! thanks for the info!
exten => s,1,Set(CALLERID(name)=${ARG2}${CALLERID(name)})
exten => s,2,Dial(SIP/${DIALED_PUBLIC_NUMBER}@${ARG1}${TL_DASH}${tenant})
exten => s,3,Hangup

Submitted by eeman on Wed, 02/15/2017 Permalink

why, if the CALLEE is FreePBX,are you using an Extension? That makes no sense.

why dont you just a trunk connection, usable by that tenant only, using the from-inside-tenantname context, and for inbound route use the tl-dialout-1trunk-passthru script?