[asterisk-commits] kmoore: branch 12 r406020 - /branches/12/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 21 11:14:28 CST 2014


Author: kmoore
Date: Tue Jan 21 11:14:24 2014
New Revision: 406020

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=406020
Log:
PJSIP: Handle headers in a list appropriately

The PJSIP header parsing function (pjsip_parse_hdr) can generate more
than one header instance from a single header field. These header
instances exist as a list attached to the returned header and must be
handled appropriately when they are added to a message or else only the
first header instance will be used. This changes the linked list
functions used in outbound proxy code to merge the lists properly.

Modified:
    branches/12/res/res_pjsip.c
    branches/12/res/res_pjsip_outbound_registration.c

Modified: branches/12/res/res_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip.c?view=diff&rev=406020&r1=406019&r2=406020
==============================================================================
--- branches/12/res/res_pjsip.c (original)
+++ branches/12/res/res_pjsip.c Tue Jan 21 11:14:24 2014
@@ -1539,7 +1539,7 @@
 			pjsip_dlg_terminate(dlg);
 			return NULL;
 		}
-		pj_list_push_back(&route_set, route);
+		pj_list_insert_nodes_before(&route_set, route);
 
 		pjsip_dlg_set_route_set(dlg, &route_set);
 	}
@@ -1901,7 +1901,7 @@
 		return -1;
 	}
 
-	pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)route);
+	pj_list_insert_nodes_before(&tdata->msg->hdr, (pjsip_hdr*)route);
 
 	return 0;
 }

Modified: branches/12/res/res_pjsip_outbound_registration.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_outbound_registration.c?view=diff&rev=406020&r1=406019&r2=406020
==============================================================================
--- branches/12/res/res_pjsip_outbound_registration.c (original)
+++ branches/12/res/res_pjsip_outbound_registration.c Tue Jan 21 11:14:24 2014
@@ -779,7 +779,7 @@
 		if (!(route = pjsip_parse_hdr(pjsip_regc_get_pool(registration->state->client_state->client), &ROUTE_HNAME, tmp.ptr, tmp.slen, NULL))) {
 			return -1;
 		}
-		pj_list_push_back(&route_set, route);
+		pj_list_insert_nodes_before(&route_set, route);
 
 		pjsip_regc_set_route_set(registration->state->client_state->client, &route_set);
 	}




More information about the asterisk-commits mailing list