[Asterisk-code-review] res pjsip: Prevent "user=phone" being added multiple times t... (asterisk[master])

Sean Bright asteriskteam at digium.com
Wed Oct 11 15:36:29 CDT 2017


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/6757


Change subject: res_pjsip: Prevent "user=phone" being added multiple times to header
......................................................................

res_pjsip: Prevent "user=phone" being added multiple times to header

ast_sip_add_usereqphone adds "user=phone" to the header every time is is
called without checking whether the param already exists. Preventing
this by searching to string representation of header for "user=phone".

ASTERISK-26988 #close

Change-Id: Ib84383b07254de357dc6a98d91fc1d2c2c3719e6
---
M res/res_pjsip.c
1 file changed, 5 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/57/6757/1

diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index a784e12..f81d34c 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3095,6 +3095,11 @@
 		return;
 	}
 
+	if (pjsip_param_find(&sip_uri->other_param, &STR_USER)) {
+		/* Don't add it if it's already there */
+		return;
+	}
+
 	param = PJ_POOL_ALLOC_T(pool, pjsip_param);
 	param->name = STR_USER;
 	param->value = STR_PHONE;

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib84383b07254de357dc6a98d91fc1d2c2c3719e6
Gerrit-Change-Number: 6757
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: dtryba <daniel at tryba.nl>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171011/4d764a0c/attachment.html>


More information about the asterisk-code-review mailing list