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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2019-03-22T04:34:26+01:00

dialog: parse headers for request and transfer reply for errors

---

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

---

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

---

diff --git a/src/modules/dialog/dlg_handlers.c 
b/src/modules/dialog/dlg_handlers.c
index 80389a3446..7e8d72b6c7 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)
        {


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to