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

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


Module: kamailio
Branch: master
Commit: cc12bc17587df3e4f2e02dbd05bee4946bda6d5c
URL: https://github.com/kamailio/kamailio/commit/cc12bc17587df3e4f2e02dbd05bee4946bda6d5c

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-11-07T10:53:05+01:00

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

- some headers can appear many times

---

Modified: src/modules/dialog/dlg_handlers.c

---

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

---

diff --git a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c
index d4b70690d8..dcd06a845d 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -189,6 +189,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 */
@@ -210,19 +215,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