[asterisk-app-dev] Setting custom SIP headers with ARI when originating a channel (PJSIP)
Sotiris Ganouris
topgan1 at gmail.com
Wed Oct 4 06:47:11 CDT 2017
Hello list,
I am trying to set two headers (P-Asserted-Id and Privacy) when originating a channel from a Stasis app that uses ARI and PJSIP with no success so far.
What I’ve done so far:
- Found this issue (https://issues.asterisk.org/jira/browse/ASTERISK-26178 <https://issues.asterisk.org/jira/browse/ASTERISK-26178>) on Asterisk's JIRA with someone that had the same problem and he provided a patch but the issue was closed cause apparently this is already supported by ARI. There is no proposed solution there and I already tried leaving a comment there.
- Setting the "variables” array when doing the ChannelOriginateWithId (https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Channels+REST+API#Asterisk14ChannelsRESTAPI-originate <https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Channels+REST+API#Asterisk14ChannelsRESTAPI-originate>) like so:
{"variables":{ "PJSIP_HEADER(add,P-Asserted-Id)": "1234567890 <sip:1234567890 at x.x.x.x>" }} - Is this the chan_pjsip way to do so? ARI responds with 200 and properly does the call but without the header set.
- Setting the “variables” array when doing the ChannelOriginateWithId like so:
{"variables":{ “SIPADDHEADER01": “P-Asstered-Id: 1234567890 <sip:1234567890 at x.x.x.x>" }} - This is not working cause is supported only from chan_sip.
The documentation for setting headers with PJSIP is only for the dial plan function (https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Function_PJSIP_HEADER <https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Function_PJSIP_HEADER>) but there are no documentation or example how this will work when someone wants to use ARI
Can someone provide me a working example on how to set sip headers with ARI's ChannelOriginateWithId? I’m using Asterisk 14.0.4
Thank you in advance.
Sotiris Ganouris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20171004/6520ef64/attachment.html>
More information about the asterisk-app-dev
mailing list