Custom trunk context to remove 1 from DID


(Jared Busch) #1

I was migrating a client to a new carrier when I found this old custom context on their system.
I had forgotten about setting this up. But it was quite useful at the time.

Thankfully most carriers, I deal with, now let you choose the format to have the calls delivered.

Drop this in extensions_custom.conf and then set your trunk to from-pstn-us. I believe the carrier was one called Vitelity. They don’t exist anymore (well bought/rebranded to Voyent).

They sent all inbound DID as 11 digit numbers, not E164 with the +.

;-------------------------------------------------------------------------------
[from-pstn-us]
; Copied from the beginning of [from-pstn-e164-us] with the + removed and EXTEN substring updated.
; used for trunk context of carrier that sends US DID as 11 digits.
exten => _1NXXNXXXXXX/_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => _1NXXNXXXXXX/_NXXNXXXXXX,2,Goto(from-pstn,${EXTEN:1},1)
exten => _1NXXNXXXXXX/_+NX.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => _1NXXNXXXXXX/_011NX.,n,Goto(from-pstn,${EXTEN:1},1)
exten => _1NXXNXXXXXX,1,Goto(from-pstn,${EXTEN:1},1)
exten => s,1,Goto(from-pstn,${EXTEN},1)
;-------------------------------------------------------------------------------

(Lorne Gaetz) #2

You don’t require the [from-pstn-custom] lines for this to work, and in fact might cause an infinite loop in some circumstances. Best to heed my standing advice which is “never, ever use from-pstn-custom”.


(Jared Busch) #3

You are correct, of course. I didn’t even think about it today.
I just copy/pasted what I found on the system before removing it as no longer needed.

I can’t blame anyone else. I hacked this together years ago. :stuck_out_tongue:

Removing it for anyone that finds this and wants to use it in the future…


(system) closed #4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.