[Asterisk-code-review] res pjsip: Fix known compact header issues (asterisk[13])
Joshua Elson
asteriskteam at digium.com
Sat Dec 31 19:57:14 CST 2016
Joshua Elson has uploaded a new change for review. ( https://gerrit.asterisk.org/4687 )
Change subject: res_pjsip: Fix known compact header issues
......................................................................
res_pjsip: Fix known compact header issues
ASTERISK-26684 #close
Change-Id: Ifd7e401c45015119dd5e8421dbfe3afa6381744a
---
M res/res_pjsip.c
M res/res_pjsip_diversion.c
M res/res_pjsip_refer.c
3 files changed, 7 insertions(+), 4 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/87/4687/1
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index b1adf0e..12c3baa 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3244,8 +3244,9 @@
pjsip_contact_hdr *contact_hdr;
pjsip_sip_uri *contact_uri;
static const pj_str_t HCONTACT = { "Contact", 7 };
+ static const pj_str_t HCONTACTSHORT = { "m", 1 };
- contact_hdr = pjsip_msg_find_hdr_by_name((*tdata)->msg, &HCONTACT, NULL);
+ contact_hdr = pjsip_msg_find_hdr_by_names((*tdata)->msg, &HCONTACT, &HCONTACTSHORT, NULL);
if (contact_hdr) {
contact_uri = pjsip_uri_get_uri(contact_hdr->uri);
pj_strdup2(pool, &contact_uri->user, endpoint->contact_user);
diff --git a/res/res_pjsip_diversion.c b/res/res_pjsip_diversion.c
index b9225de..a9ffdf4 100644
--- a/res/res_pjsip_diversion.c
+++ b/res/res_pjsip_diversion.c
@@ -277,6 +277,7 @@
static void diversion_incoming_response(struct ast_sip_session *session, pjsip_rx_data *rdata)
{
static const pj_str_t contact_name = { "Contact", 7 };
+ static const pj_str_t contact_name_s = { "m", 1 };
pjsip_status_line status = rdata->msg_info.msg->line.status;
pjsip_fromto_hdr *div_hdr;
@@ -292,7 +293,7 @@
div_hdr = PJSIP_MSG_TO_HDR(rdata->msg_info.msg);
}
- contact_hdr = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &contact_name, NULL);
+ contact_hdr = pjsip_msg_find_hdr_by_names(rdata->msg_info.msg, &contact_name, &contact_name_s, NULL);
set_redirecting(session, div_hdr, contact_hdr ? (pjsip_name_addr*)contact_hdr->uri :
(pjsip_name_addr*)PJSIP_MSG_FROM_HDR(rdata->msg_info.msg)->uri);
diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c
index 99295d5..77b1a54 100644
--- a/res/res_pjsip_refer.c
+++ b/res/res_pjsip_refer.c
@@ -573,6 +573,7 @@
pjsip_generic_string_hdr *referred_by;
static const pj_str_t str_referred_by = { "Referred-By", 11 };
+ static const pj_str_t str_referred_by_s = { "b", 1 };
pbx_builtin_setvar_helper(chan, "SIPTRANSFER", "yes");
@@ -651,8 +652,8 @@
pbx_builtin_setvar_helper(chan, "SIPREFERRINGCONTEXT", S_OR(refer->context, NULL));
- referred_by = pjsip_msg_find_hdr_by_name(refer->rdata->msg_info.msg,
- &str_referred_by, NULL);
+ referred_by = pjsip_msg_find_hdr_by_names(refer->rdata->msg_info.msg,
+ &str_referred_by, &str_referred_by_s, NULL);
if (referred_by) {
size_t uri_size = pj_strlen(&referred_by->hvalue) + 1;
char *uri = ast_alloca(uri_size);
--
To view, visit https://gerrit.asterisk.org/4687
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd7e401c45015119dd5e8421dbfe3afa6381744a
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Elson <joshelson at gmail.com>
More information about the asterisk-code-review
mailing list