[Asterisk-code-review] res_pjsip_session: Add custom parameter support. (asterisk[master])

Sean Bright asteriskteam at digium.com
Mon Jul 25 11:35:15 CDT 2022


Attention is currently required from: N A, Joshua Colp, George Joseph.
Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/18830 )

Change subject: res_pjsip_session: Add custom parameter support.
......................................................................


Patch Set 1:

(2 comments)

File res/res_pjsip_session.c:

https://gerrit.asterisk.org/c/asterisk/+/18830/comment/b693df0e_07ffef1c 
PS1, Line 1703: 	/* Set URI (inside the <>, as opposed to header (outside the <>)) parameters, if requested.
              : 	 * This is often necessary for SS7 trunking over SIP. Most carriers require
              : 	 * that added parameters be URI parameters (as opposed to header parameters).
              : 	 *
              : 	 * other_param is how to add custom URI parameters to the header
              : 	 * XXX: header_param is for header parameters, but doesn't seem to work at the moment.
              : 	 *
              : 	 * Especially when dealing with SS7 or TDM elements over SIP,
              : 	 * injecting parameters into the user and/or method parameters
              : 	 * is required.
              : 	 *
              : 	 * For example, if wanted to set the isup-oli parameter to the channel's ANI2 value:
              : 	 * e.g. pjsip_param_add(dlg_pool, &dlg_info_uri->other_param, "isup-oli", ani2);
> I can trim this down as suggested. […]
<sip:foo at bar.com;p1=abc;p2=def?h1=qrs&h2=tuv>;o1=foo;o2=bar

p1 and p2 are URI parameters
h1 and h2 are headers ("URI headers" to avoid confusion)
o1 and o2 are parameters and depending on the header they appear in (From, To, Contact, etc.) could be called "from parameters" or just "header parameters."

The important takeaway is that o1 and o2 have nothing to do with the URI.


https://gerrit.asterisk.org/c/asterisk/+/18830/comment/c70d555a_9a01e659 
PS1, Line 1731: 	while ((param_value = strsep(&params, ","))) {
              : 			param_name = strsep(&param_value, "=");
> Parameter names wouldn't contain equal signs, so I don't think the strsep on = is an issue.

They are permitted to contain them as long as they are escaped. We are leveraging the PJSIP stack to do that escaping for us (ideally) so we should be able to add a parameter with name "name" and a value of "surname=bright,first=sean" and it should work fine.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18830
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ifb1bc3c512ad5f6faeaebd7817f004a2ecbd6428
Gerrit-Change-Number: 18830
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-Attention: N A <mail at interlinked.x10host.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: George Joseph <gjoseph at digium.com>
Gerrit-Comment-Date: Mon, 25 Jul 2022 16:35:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sean Bright <sean at seanbright.com>
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220725/fdac0812/attachment.html>


More information about the asterisk-code-review mailing list