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
certified/13.21
Sean Bright 7 years ago
parent fdf988cd28
commit 54efc0c637

@ -3126,8 +3126,6 @@ void ast_sip_add_usereqphone(const struct ast_sip_endpoint *endpoint, pj_pool_t
{ {
pjsip_sip_uri *sip_uri; pjsip_sip_uri *sip_uri;
int i = 0; int i = 0;
pjsip_param *param;
static const pj_str_t STR_USER = { "user", 4 };
static const pj_str_t STR_PHONE = { "phone", 5 }; 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))) { if (!endpoint || !endpoint->usereqphone || (!PJSIP_URI_SCHEME_IS_SIP(uri) && !PJSIP_URI_SCHEME_IS_SIPS(uri))) {
@ -3155,15 +3153,7 @@ void ast_sip_add_usereqphone(const struct ast_sip_endpoint *endpoint, pj_pool_t
return; return;
} }
if (pjsip_param_find(&sip_uri->other_param, &STR_USER)) { sip_uri->user_param = STR_PHONE;
/* 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);
} }
pjsip_dialog *ast_sip_create_dialog_uac(const struct ast_sip_endpoint *endpoint, pjsip_dialog *ast_sip_create_dialog_uac(const struct ast_sip_endpoint *endpoint,

Loading…
Cancel
Save