[asterisk-commits] mmichelson: branch 12 r415579 - /branches/12/res/res_pjsip_header_funcs.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 9 15:21:04 CDT 2014


Author: mmichelson
Date: Mon Jun  9 15:20:50 2014
New Revision: 415579

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=415579
Log:
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.


Modified:
    branches/12/res/res_pjsip_header_funcs.c

Modified: branches/12/res/res_pjsip_header_funcs.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_header_funcs.c?view=diff&rev=415579&r1=415578&r2=415579
==============================================================================
--- branches/12/res/res_pjsip_header_funcs.c (original)
+++ branches/12/res/res_pjsip_header_funcs.c Mon Jun  9 15:20:50 2014
@@ -592,6 +592,7 @@
 	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 = {




More information about the asterisk-commits mailing list