Dialplan Help

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,280
Reaction score
340
Hey all! long time no see! Work has been, well, work, always busy with no end in sight.

I have so many DID's that I kind of lost track of my DID's with DryVoip. They are no longer working with the solution I posted years ago to use a certain context, so now I must roll my own context for them. I found in their SIP header they are including a new one:
Code:
X-DryVoIP-DNID: 6135551212
This is effectively your DID identifier.
I contacted DryVoip support hoping they'd have a simple solution, but all they came back with is "I suggest you try ${PJSIP_HEADER(read,X-DryVoIP-DNID)}".

So, I've been messing with the from-pstn-toheader context, trying to modify it to my needs.

Code:
[from-pstn-toheader]
exten =>  _.,1,NoOp(Attempting to extract DID from SIP To header)
exten =>  _.,n,gotoif($["${CHANNEL(channeltype)}"="SIP"]?SIP)
exten =>  _.,n,gotoif($["${CHANNEL(channeltype)}"="PJSIP"]?PJSIP)
exten =>  _.,n,NoOp(Unable to determine SIP channel type)
exten =>  _.,n,goto(from-pstn,${EXTEN},1))
exten =>  _.,n(SIP),Goto(from-pstn,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)
exten =>  _.,n(PJSIP),Goto(from-pstn,${CUT(CUT(PJSIP_HEADER(read,To),@,1),:,2)},1)

Does anyone know what I need to do to make that last line (I'm using PJSIP) effectively read the DNID header from DryVoip and send the call back in to from-pstn? I'm pulling my hair out for something that is probably really, really simple.
 
Have you looked through the asterisk log file to see what's being sent by DryVoip?
 
The to just had my account, like I said they use a SIP Header stated above to identify the DID dialed.
 
So I've done a bit of research on this. The code should extract the CallerID from the P-Asserted_Identity header.
So find this, exten => _.,n(PJSIP),Goto(from-pstn,${CUT(CUT(PJSIP_HEADER(read,To),@,1),:,2)},1) in the log file and see what it is returning.
 
So I've done a bit of research on this. The code should extract the CallerID from the P-Asserted_Identity header.
I posted the stock from-pstn-toheader blob, hoping someone would chime in as to what I need to do using ${PJSIP_HEADER(read,X-DryVoIP-DNID)}.

I've tried various combinations of a string but can't get it to pull the DID. Once, just once, I had it read the DID and pull it, but it still went to catch-all. I since lost that line in fiddling. Very upset about that error on my part. LoL
 
Since you asked, I currently have this, that does not work. I'm a GUI person, don't do any coding, yet work/use Asterisk every day of my life. LoL


Code:
[from-dryvoip]
exten =>  _.,1,NoOp(Attempting to extract DID from SIP X-DryVoIP-DNID header)
exten =>  _.,n,gotoif($["${CHANNEL(channeltype)}"="SIP"]?SIP)
exten =>  _.,n,gotoif($["${CHANNEL(channeltype)}"="PJSIP"]?PJSIP)
exten =>  _.,n,NoOp(Unable to determine SIP channel type)
exten =>  _.,n,goto(from-pstn,${EXTEN},1))
exten =>  _.,n(SIP),Goto(from-pstn,${CUT(CUT(SIP_HEADER(X-DryVoIP-DNID),@,1),:,2)},1)
exten =>  _.,n(PJSIP),Goto(from-pstn,${FROMDID(PJSIP_HEADER(read,X-DryVoIP-DNID),:,2)},1)
 
You can’t fix this through the GUI and you shouldn’t need to modify the context code.

The extract you have posted is not enough to reach any conclusions. You need to post the next 10 or 20 lines of the log to see what happens after it tries to extract the DNID.
 
Have a look at this post from community.freepbx.org
 
[from-dryvoip] exten => _.,1,NoOp(Attempting to extract DID from SIP X-DryVoIP-DNID header) exten => _.,n,gotoif($["${CHANNEL(channeltype)}"="SIP"]?SIP) exten => _.,n,gotoif($["${CHANNEL(channeltype)}"="PJSIP"]?PJSIP) exten => _.,n,NoOp(Unable to determine SIP channel type) exten => _.,n,goto(from-pstn,${EXTEN},1)) exten => _.,n(SIP),Goto(from-pstn,${CUT(CUT(SIP_HEADER(X-DryVoIP-DNID),@,1),:,2)},1) exten => _.,n(PJSIP),Goto(from-pstn,${FROMDID(PJSIP_HEADER(read,X-DryVoIP-DNID),:,2)},1)
Hi the
X-DryVoIP-DNID
# does this need to be defined somewhere for this to work, with for example Sipgate instead of DryVoip ??
 
Hey all! long time no see! Work has been, well, work, always busy with no end in sight.

I have so many DID's that I kind of lost track of my DID's with DryVoip. They are no longer working with the solution I posted years ago to use a certain context, so now I must roll my own context for them. I found in their SIP header they are including a new one:
Code:
X-DryVoIP-DNID: 6135551212
This is effectively your DID identifier.
I contacted DryVoip support hoping they'd have a simple solution, but all they came back with is "I suggest you try ${PJSIP_HEADER(read,X-DryVoIP-DNID)}".

So, I've been messing with the from-pstn-toheader context, trying to modify it to my needs.

Code:
[from-pstn-toheader]
exten =>  _.,1,NoOp(Attempting to extract DID from SIP To header)
exten =>  _.,n,gotoif($["${CHANNEL(channeltype)}"="SIP"]?SIP)
exten =>  _.,n,gotoif($["${CHANNEL(channeltype)}"="PJSIP"]?PJSIP)
exten =>  _.,n,NoOp(Unable to determine SIP channel type)
exten =>  _.,n,goto(from-pstn,${EXTEN},1))
exten =>  _.,n(SIP),Goto(from-pstn,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)
exten =>  _.,n(PJSIP),Goto(from-pstn,${CUT(CUT(PJSIP_HEADER(read,To),@,1),:,2)},1)

Does anyone know what I need to do to make that last line (I'm using PJSIP) effectively read the DNID header from DryVoip and send the call back in to from-pstn? I'm pulling my hair out for something that is probably really, really simple.
It is serendipitous that this was just posted on the FreePBX forum by Lorne Gaetz:
 
I've actually started the process of porting 1 of 3 numbers to Voip.ms (my regular provider). I will try Lorne's code though and see if I have any luck with it.
 

Members online

No members online now.

Forum statistics

Threads
26,711
Messages
174,564
Members
20,278
Latest member
hessa
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top