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

Author: Federico Cabiddu <federico.cabi...@gmail.com>
Committer: Federico Cabiddu <federico.cabi...@gmail.com>
Date: 2020-04-08T14:40:17+02:00

siptrace: safety check for transaction when checking ACK

---

Modified: src/modules/siptrace/siptrace.c

---

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

---

diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index c3876c9108..a7bcde62b8 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -874,16 +874,18 @@ static int sip_trace_helper(sip_msg_t *msg, dest_info_t 
*dst, str *duri,
                        orig_t = tmb.t_gett();
                        if(tmb.t_lookup_request(msg,0,&canceled)) {
                                t_invite = tmb.t_gett();
-                               if (t_invite->uas.request->msg_flags & 
FL_SIPTRACE) {
-                                       LM_DBG("Transaction is already been 
traced, skipping.\n");
-                                       ret = 1;
+                               if (t_invite!=T_NULL_CELL) {
+                                       if (t_invite->uas.request->msg_flags & 
FL_SIPTRACE) {
+                                               LM_DBG("Transaction is already 
been traced, skipping.\n");
+                                               ret = 1;
+                                       }
+                                       tmb.t_release_transaction( t_invite );
+                                       tmb.t_unref(msg);
                                }
-                               tmb.t_release_transaction( t_invite );
-                               tmb.t_unref(msg);
-                               tmb.t_sett(orig_t, T_BR_UNDEFINED);
-                               if (ret)
-                                       return 1;
                        }
+                       tmb.t_sett(orig_t, T_BR_UNDEFINED);
+                       if (ret)
+                               return 1;
                }
 
                if (trace_type == SIPTRACE_DIALOG && dlgb.get_dlg == NULL) {


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

Reply via email to