summaryrefslogtreecommitdiff
path: root/res/res_pjsip_header_funcs.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2014-06-09 20:21:42 +0000
committerMark Michelson <mmichelson@digium.com>2014-06-09 20:21:42 +0000
commit45db91dd980d2dceac2dbde1cc6ab647ffbb078e (patch)
tree6472d4bd4cf5554724aa916ad249b518aa07a58b /res/res_pjsip_header_funcs.c
parentce733a02b49d1e6bb08c3eceabd6bed0a14ff1bd (diff)
chan_pjsip: Fix bug where custom SIP headers could be duplicated on outgoing INVITEs.
When using PJSIP_HEADER() to add custom headers to outgoing INVITE requests, certain situations could result in the headers being duplicated. For instance, if the request were retransmitted, or if the INVITE were re-sent with authentication credentials, the custom headers would be re-added to the request. The fix here is to, after adding the custom headers to the outbound INVITE, remove the datastore that holds the custom headers to add. This way, there is no risk in accidentally adding them if the session supplement is called into a second or third time. ........ Merged revisions 415579 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_header_funcs.c')
-rw-r--r--res/res_pjsip_header_funcs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/res/res_pjsip_header_funcs.c b/res/res_pjsip_header_funcs.c
index b5383fb32..dc9d6aad4 100644
--- a/res/res_pjsip_header_funcs.c
+++ b/res/res_pjsip_header_funcs.c
@@ -592,6 +592,7 @@ static void outgoing_request(struct ast_sip_session *session, pjsip_tx_data * td
AST_LIST_TRAVERSE(list, le, nextptr) {
pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *) pjsip_hdr_clone(pool, le->hdr));
}
+ ast_sip_session_remove_datastore(session, datastore->uid);
}
static struct ast_sip_session_supplement header_funcs_supplement = {