[Asterisk-code-review] res pjsip: Use pjsip sip uri.user param instead of other param (asterisk[15])

Jenkins2 asteriskteam at digium.com
Mon Feb 19 08:57:47 CST 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8211 )

Change subject: res_pjsip: Use pjsip_sip_uri.user_param instead of other_param
......................................................................

res_pjsip: Use pjsip_sip_uri.user_param instead of other_param

There is a dedicated slot in the pjsip_sip_uri for the 'user'
parameter, so use that instead of adding to the list of generic URI
parameters.

Change-Id: I0a0ce8a60ecee27489735bf56fd707719d8c2ed6
---
M res/res_pjsip.c
1 file changed, 1 insertion(+), 11 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Richard Mudgett: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 7867c52..62d282b 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3175,8 +3175,6 @@
 {
 	pjsip_sip_uri *sip_uri;
 	int i = 0;
-	pjsip_param *param;
-	static const pj_str_t STR_USER = { "user", 4 };
 	static const pj_str_t STR_PHONE = { "phone", 5 };
 
 	if (!endpoint || !endpoint->usereqphone || (!PJSIP_URI_SCHEME_IS_SIP(uri) && !PJSIP_URI_SCHEME_IS_SIPS(uri))) {
@@ -3204,15 +3202,7 @@
 		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;
-	pj_list_insert_before(&sip_uri->other_param, param);
+	sip_uri->user_param = STR_PHONE;
 }
 
 pjsip_dialog *ast_sip_create_dialog_uac(const struct ast_sip_endpoint *endpoint,

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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I0a0ce8a60ecee27489735bf56fd707719d8c2ed6
Gerrit-Change-Number: 8211
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180219/147b5bda/attachment.html>


More information about the asterisk-code-review mailing list