I am using asterisk 13.9.1 with the PJSIP channels and I need the possibility to exchange SIP headers between two (or more) PJSIP channels.
At the beginning of a call, I can using a pre-dial-handler to exchange SIP headers.
Is it possible to exchange SIP Headers from an incoming SIP response message to an outgoing SIP response message?
I need this feature to pass through SIP headers through Asterisk.
You will need to read the header and then add it on the outgoing side. This won’t work for key headers, like call-id, and it is unwise to do it for any header that Asterisk itself uses.
Asterisk is a back to back user agent, so the two legs aren’t necessarily the same technology and passing through raw protocol values is not something normal.
Thank you for the information.
You have right. This is not working with the key headers, but if you want to transfer a proprietary headers (e.g. X-MyHeader) from the incoming leg to the outgoing leg you need this possibility!
In my case, both channels use the same technology.
Is it possible to transfer it via AMI interface etc.
No, it’s not possible to modify the SIP responses. You can only read from the initial INVITE and add to the initial INVITE.
is there a technical reason why the exchange of SIP headers response is not supported?
Support for it has not been written, and the way it would work has not been explored or defined.