[Asterisk-code-review] res pjsip caller id: Copy header name to short header name (asterisk[14.0])

Joshua Colp asteriskteam at digium.com
Fri Aug 12 06:08:19 CDT 2016


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/3519

Change subject: res_pjsip_caller_id:  Copy header name to short header name
......................................................................

res_pjsip_caller_id:  Copy header name to short header name

When compact_headers was set, we were sending a zero-length header name
for PAI and RPID because we always forced the short header name length
to 0.  We did this because we cloned the header from "From" and wanted
to clear "f" from the sname.  By cloning however, we bypass pjproject's
automatic logic that sets sname to name if there's no compact form of
the header, which there isn't for PAI and RPID.  So now we force sname
to be the same as name right after we set name.

res_pjsip_diversion needed the same treatment for the Diversion header.

ASTERISK-26241 #close

Change-Id: I633ec139630cd83809aae00336cee4a10077e467
---
M res/res_pjsip_caller_id.c
M res/res_pjsip_diversion.c
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/19/3519/1

diff --git a/res/res_pjsip_caller_id.c b/res/res_pjsip_caller_id.c
index 283ec94..429cb61 100644
--- a/res/res_pjsip_caller_id.c
+++ b/res/res_pjsip_caller_id.c
@@ -413,7 +413,7 @@
 	id_hdr = pjsip_from_hdr_create(tdata->pool);
 	id_hdr->type = PJSIP_H_OTHER;
 	pj_strdup(tdata->pool, &id_hdr->name, hdr_name);
-	id_hdr->sname.slen = 0;
+	id_hdr->sname = id_hdr->name;
 
 	id_name_addr = pjsip_uri_clone(tdata->pool, base->uri);
 	id_uri = pjsip_uri_get_uri(id_name_addr->uri);
diff --git a/res/res_pjsip_diversion.c b/res/res_pjsip_diversion.c
index f1a6ddf..82c3caa 100644
--- a/res/res_pjsip_diversion.c
+++ b/res/res_pjsip_diversion.c
@@ -305,7 +305,7 @@
 	hdr = pjsip_from_hdr_create(tdata->pool);
 	hdr->type = PJSIP_H_OTHER;
 	pj_strdup(tdata->pool, &hdr->name, &diversion_name);
-	hdr->sname.slen = 0;
+	hdr->sname = hdr->name;
 
 	name_addr = pjsip_uri_clone(tdata->pool, base);
 	uri = pjsip_uri_get_uri(name_addr->uri);

-- 
To view, visit https://gerrit.asterisk.org/3519
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I633ec139630cd83809aae00336cee4a10077e467
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14.0
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>



More information about the asterisk-code-review mailing list