Not able to detect DID for sip trunk (

Hi Guys,

I got new sip trunk setup by

i have 5 DID attached to my primary SIP account, ( i want 5 Direct dial in number)
but when i am able to recieve calls form all 5 DID and when i spoke to Tech from engin they told me that all the call will be delivered by primary sip gateway which means it will have incoming DID of Primary SIP trunk number but if i do proper setting in my pbx i should be able to strip the packet information and will be able to find the DID and will be able to route call to right extension,

when i did wireshark scan for sip packets i can see the dialled number information is available in the packets but i am now sure how i can make it work in asterisk.

here i did bit of research but still no sucess.

pls refer to … ounts.html
and … Workaround

extension.conf file:

exten => s,1,NoOp(${SIP_HEADER(To)})
exten => s,n,Set(DID=${SIP_HEADER(To)})
exten => s,n,Set(DID=${CUT(DID,:,2)})
exten => s,n,Set(DID=${CUT(DID,@,1)})
exten => s,n,Goto(from-pstn,${DID},1)

but no success, can anyone help me please.

I am running Asterisk Now with Freebx


For help in making it work in FreePBX, use a forum.

If the dialed number is in the right place, you should replace the s, in your dialplan, by the dialed number.