[sr-dev] git:5.1:5e7201ef: dialog: parse headers for request and transfer reply for errors

Daniel-Constantin Mierla miconda at gmail.com
Thu Apr 4 12:59:12 CEST 2019


Module: kamailio
Branch: 5.1
Commit: 5e7201ef86ab6152034989728272204ef02a4685
URL: https://github.com/kamailio/kamailio/commit/5e7201ef86ab6152034989728272204ef02a4685

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

dialog: parse headers for request and transfer reply for errors

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

---

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

---

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

---

diff --git a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c
index a2f50b7e3e..296a2d5c61 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -852,6 +852,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