[sr-dev] git:5.0:17dab529: dialog: parse headers for request and transfer reply for errors

Daniel-Constantin Mierla miconda at gmail.com
Thu Apr 4 13:02:39 CEST 2019


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-04-04T12:59:59+02:00

dialog: parse headers for request and transfer reply for errors

(cherry picked from commit 4e1ebc6b446e6264f91c96deaed0548de353d731)
(cherry picked from commit b4df4fc4b0401b522b7fce516e286aec85d4ad96)
(cherry picked from commit 5e7201ef86ab6152034989728272204ef02a4685)

---

Modified: src/modules/dialog/dlg_handlers.c
Modified: src/modules/dialog/dlg_transfer.c

---

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

---

diff --git a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c
index 303513b065..80f9a9890d 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -849,6 +849,11 @@ int dlg_new_dialog(sip_msg_t *req, struct cell *t, const int run_initial_cbs)
 	if(req->first_line.u.request.method_value != METHOD_INVITE)
 		return -1;
 
+	if(parse_headers(req, HDR_EOH_F, 0) < 0) {
+		LM_ERR("failed to parse the request headers\n");
+		return -1;
+	}
+
     if(pre_match_parse( req, &callid, &ftag, &ttag, 0)<0) {
         LM_WARN("pre-matching failed\n");
         return -1;
diff --git a/src/modules/dialog/dlg_transfer.c b/src/modules/dialog/dlg_transfer.c
index f3e594bcbe..a920eb52c1 100644
--- a/src/modules/dialog/dlg_transfer.c
+++ b/src/modules/dialog/dlg_transfer.c
@@ -252,6 +252,10 @@ void dlg_bridge_tm_callback(struct cell *t, int type, struct tmcb_params *ps)
 
 	/* 2xx - build dialog/send refer */
 	msg = ps->rpl;
+	if(parse_headers(msg, HDR_EOH_F, 0) < 0) {
+		LM_ERR("failed to parse the reply headers\n");
+		goto error;
+	}
 	if((msg->cseq==NULL || parse_headers(msg,HDR_CSEQ_F,0)<0)
 			|| msg->cseq==NULL || msg->cseq->parsed==NULL)
 	{




More information about the sr-dev mailing list