[Asterisk-code-review] res_pjsip_session: Add custom parameter support. (asterisk[master])
Alexei Gradinari
asteriskteam at digium.com
Tue Jul 26 12:53:07 CDT 2022
Attention is currently required from: N A, Joshua Colp, George Joseph.
Alexei Gradinari 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:
(1 comment)
File doc/CHANGES-staging/res_pjsip_session_params.txt:
https://gerrit.asterisk.org/c/asterisk/+/18830/comment/bd2d33db_ae05fa51
PS1, Line 5: SIPURIPARAMETERS variable on a channel
> I guess that would mean no variable under the hood either, the way that chan_sip does it for instanc […]
pjsip_sip_uri *uri = NULL;
switch (hdr->type) {
case PJSIP_H_TO:
case PJSIP_H_FROM:
if (is_sip_uri(((pjsip_fromto_hdr *) hdr)->uri)) {
uri = pjsip_uri_get_uri(((pjsip_fromto_hdr *) hdr)->uri);
}
break;
case PJSIP_H_CONTACT:
if (!((pjsip_contact_hdr *) hdr)->star && is_sip_uri(((pjsip_contact_hdr *) hdr)->uri)) {
uri = pjsip_uri_get_uri(((pjsip_contact_hdr *) hdr)->uri);
}
break;
}
if (!uri) {
ast_log(AST_LOG_WARNING, "Unsupported header %s", hdr->name);
return -1;
}
// to read
pjsip_param *x_param = pjsip_param_find(&uri->other_param, &name);
// to remove
pjsip_param *x_param = pjsip_param_find(&uri->other_param, &name);
pj_list_erase(x_param);
// to add
pjsip_param *x_param;
// set x_param
pj_list_push_back(&uri->other_param, x_param)
// to update
pjsip_param *x_param = pjsip_param_find(&uri->other_param, &name);
// replace x_param->value
--
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-CC: Alexei Gradinari <alex2grad at gmail.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: Tue, 26 Jul 2022 17:53:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Comment-In-Reply-To: Joshua Colp <jcolp at sangoma.com>
Comment-In-Reply-To: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220726/370eaae6/attachment.html>
More information about the asterisk-code-review
mailing list