AMI Originate multiple SIPAddHeader

Hi all,

I would like to add multiple custom SIP headers when Originating a call via AMI

This solution explains how to add 1 header:

Action: Originate
Channel:......
....
Variable: __SIPADDHEADER51=X-Your-Header: header-val
...
...

What would be the syntax if I want to and some other custom SIP headers?

https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Function_PJSIP_HEADER

Thank you, I guess from you answer it would be something like

Action: Originate
Channel:......
....
Variable: __SIPADDHEADER51=X-Your-Header: header-val
Variable: __SIPADDHEADER52=X-Your-Header: header-val
Variable: __SIPADDHEADER53=X-Your-Header: header-val
...

Right?

Yes, that’s part of the solution. I don’t think you need the double underscore for a simple callback file and then you would use the variables in the specified extension to actually add the headers for the upcoming SIP session.

I am still using Set and that still works, but I think it is now Setvar and not Variable.

The SIPADDHEADER method only works for chan_sip, which is deprecated and will be withdrawn next year. You should be attempting to move to chan_pjsip.

I don’t think you need any _s here, as you are setting the variable (or for chan_pjsip, running the function) directly on the channel that uses it.

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