[asterisk-bugs] [JIRA] (ASTERISK-26178) Setting custom SIP headers in PJSIP when using ARI

Sebastian (JIRA) noreply at issues.asterisk.org
Thu Jul 7 07:38:56 CDT 2016


    [ https://issues.asterisk.org/jira/browse/ASTERISK-26178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=231327#comment-231327 ] 

Sebastian commented on ASTERISK-26178:
--------------------------------------

I need the headers to be set on the initial INVITE that is sent in order to pick the values up on the receiving Asterisk. We also have some services which capture SIP traffic off the network and we want to be able to match the header values for captured SIP conversations.

The problem is that when originating with ari is that it only hands the channel over to the dialplan or stasis application after the channel has been answered so there is no way to set  custom headers on the initial INVITE. I realize that one can use the Local channel to loop back into the dialplan and then call, however this causes extra complexity when trying to manage the channels. We are trying to keep as much of the call routing and management logic in our application and not in the dialplan.

> Setting custom SIP headers in PJSIP when using ARI
> --------------------------------------------------
>
>                 Key: ASTERISK-26178
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26178
>             Project: Asterisk
>          Issue Type: New Feature
>      Security Level: None
>          Components: Resources/res_pjsip
>    Affects Versions: 13.5.0, 13.9.1
>         Environment: Asterisk 13, PJSIP channel driver
>            Reporter: Sebastian
>            Assignee: Sebastian
>            Severity: Minor
>         Attachments: pjsipaddheader.patch
>
>
> We currently have an application that is using the ARI exclusively for managing calls. What we need is a mechanism to set custom SIP headers when originating a new channel via the ARI. This is possible with the old chan_sip driver but creating a variable called "SIPADDHEADERXX", the contents of which are added to the INVITE as a custom header when the INVITE is created.
> We need the same functionality for the PJSIP channel driver so I have created a patch for chan_pjsip.c that implements this functionality in the same manner - you can set a varaiable called "PJSIPADDHEADERXX" and in the call() method in chan_pjsip.c it will add the header to the INVITE before sending it.
> This is working for me right now, I would just like to know though whether this is something that has been otherwise planned already? I can't find any reference to it here or on Google. If not, is this a valid/recommended means of doing this?
> I'm happy to do the work in order to implement this properly, if someone could give me some guidance as to how best to implement it? I'm sure someone else out there also needs this functionality.
> I've attached the patch here, it works great in versions 13.5.0 and 13.9.1 where I have tested it thus far. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list