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

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2024-01-23T21:05:41+01:00

tm: release transaction on kill if a final response was sent

- do not send another final response for error cases

---

Modified: src/modules/tm/t_funcs.c

---

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

---

diff --git a/src/modules/tm/t_funcs.c b/src/modules/tm/t_funcs.c
index b9f9949d0fb..5515a4aba6f 100644
--- a/src/modules/tm/t_funcs.c
+++ b/src/modules/tm/t_funcs.c
@@ -177,6 +177,11 @@ int kill_transaction(struct cell *trans, int error)
        int reply_ret;
        int ret;
 
+       if((trans->uas.request != NULL)
+                       && (trans->uas.request->msg_flags & FL_FINAL_REPLY)) {
+               return t_release_transaction(trans);
+       }
+
        /*  we reply statefully and enter WAIT state since error might
                have occurred in middle of forking and we do not
                want to put the forking burden on upstream client;
@@ -205,6 +210,11 @@ int kill_transaction_unsafe(struct cell *trans, int error)
        int reply_ret;
        int ret;
 
+       if((trans->uas.request != NULL)
+                       && (trans->uas.request->msg_flags & FL_FINAL_REPLY)) {
+               return t_release_transaction(trans);
+       }
+
        /*  we reply statefully and enter WAIT state since error might
                have occurred in middle of forking and we do not
                want to put the forking burden on upstream client;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to