diff options
author | Daniel Tryba <daniel@tryba.nl> | 2017-10-06 12:14:40 +0200 |
---|---|---|
committer | Sean Bright <sean.bright@gmail.com> | 2017-10-11 16:34:52 -0400 |
commit | af09996178629488898f5cdb9e57e1eca17031d8 (patch) | |
tree | dd55ef9b3edfe0d7b96f71755f4fdae55ee33454 | |
parent | 4a2caab4f6eb7e468660f44271bde2e09252e247 (diff) |
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
-rw-r--r-- | res/res_pjsip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 510b6b4fd..e215946a3 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -3073,6 +3073,11 @@ void ast_sip_add_usereqphone(const struct ast_sip_endpoint *endpoint, pj_pool_t 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; |