[sr-dev] git:5.0:a3d3ea83: dialog: parse all headers before getting the message attributes for dialog

Daniel-Constantin Mierla miconda at gmail.com
Tue Nov 7 11:03:24 CET 2017


Module: kamailio
Branch: 5.0
Commit: a3d3ea837b0f4011a3ca0e51ad4a1516bb211299
URL: https://github.com/kamailio/kamailio/commit/a3d3ea837b0f4011a3ca0e51ad4a1516bb211299

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-11-07T11:02:56+01:00

dialog: parse all headers before getting the message attributes for dialog

- some headers can appear many times

(cherry picked from commit cc12bc17587df3e4f2e02dbd05bee4946bda6d5c)

---

Modified: src/modules/dialog/dlg_handlers.c

---

Diff:  https://github.com/kamailio/kamailio/commit/a3d3ea837b0f4011a3ca0e51ad4a1516bb211299.diff
Patch: https://github.com/kamailio/kamailio/commit/a3d3ea837b0f4011a3ca0e51ad4a1516bb211299.patch

---

diff --git a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c
index 642f9c1caf..886219543c 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -186,6 +186,11 @@ int populate_leg_info( struct dlg_cell *dlg, struct sip_msg *msg,
 	str contact;
 	str rr_set;
 
+	if(parse_headers(msg,HDR_EOH_F,0)<0){
+		LM_ERR("failed to parse headers\n");
+		goto error0;
+	}
+
 	dlg->bind_addr[leg] = msg->rcv.bind_address;
 
 	/* extract the cseq number as string */
@@ -207,19 +212,14 @@ int populate_leg_info( struct dlg_cell *dlg, struct sip_msg *msg,
 		goto error0;
 	}
 	if ( parse_contact(msg->contact)<0 ||
-	((contact_body_t *)msg->contact->parsed)->contacts==NULL ||
-	((contact_body_t *)msg->contact->parsed)->contacts->next!=NULL ) {
+			((contact_body_t *)msg->contact->parsed)->contacts==NULL ||
+			((contact_body_t *)msg->contact->parsed)->contacts->next!=NULL ) {
 		LM_ERR("bad Contact HDR\n");
 		goto error0;
 	}
 	contact = ((contact_body_t *)msg->contact->parsed)->contacts->uri;
 
-	/* extract the RR parts */
-	if(!msg->record_route && (parse_headers(msg,HDR_EOH_F,0)<0)  ){
-		LM_ERR("failed to parse record route header\n");
-		goto error0;
-	}
-
+	/* extract the record-route addresses */
 	if (leg==DLG_CALLER_LEG) {
 		skip_recs = 0;
 	} else {




More information about the sr-dev mailing list