Hey there,
I’m running Asterisk 1.6 with FreePBX.
I need to be able to set the npdi and rn parameters in the To header on my SIP invites, however I can’t seem to get it working.
Using this code below in extentions_custom.conf:
[macro-dialout-trunk-predial-hook]
exten => s,1,Set(__SIP_URI_OPTIONS=npdi=yes\;rn=8082900191)
exten => s,n,MacroExit()
I can set the To header as such:
To: <sip:8081010007@172.22.135.22;npdi=yes;rn=8082900191>;tag=blah
However I believe what I need to do is this:
To: <sip:8081010007@172.22.135.22>;npdi=yes;rn=8082900191;tag=blah
Is this even possible? And if so can anybody help me do it?
Thanks
SIP_URI_OPTIONS won’t work the way you’d like. You’ll have to dive into the code to change it.
Hey Malcolm,
Thanks for your speedy reply - do you mean I would need to dive into the asterisk code itself (as opposed to modifying this in the *.conf files).
Thanks,
Laurence
Yes. You cannot change the functionality of that SIP channel variable by editing configuration files. You’ll have to edit the source.
Hey Malcolm,
Thanks for your help - turns out my understanding of the rn and npdi parameters was incorrect and what I wanted to send was:
INVITE sip:8081010001;npdi=yes;rn=8081010000@172.22.135.22 SIP/2.0
In case anybody wants to do the same -
I still set this in extentions_custom.conf:
[macro-dialout-trunk-predial-hook]
exten => s,1,Set(__SIP_URI_OPTIONS=npdi=yes\;rn=8082900191)
exten => s,n,MacroExit()
I then made some minor changes to chan_sip.c so that SIP_URI_OPTIONS was added before the @ in the request URI.
Thanks for your help.
Laurence
system
6
Would you share what changes were made to chan_sip.c?