Module: kamailio
Branch: master
Commit: 695f155f3a127f0bbe220a6b44a0fc3887e1e4be
URL: 
https://github.com/kamailio/kamailio/commit/695f155f3a127f0bbe220a6b44a0fc3887e1e4be

Author: Federico Cabiddu <federico.cabi...@gmail.com>
Committer: GitHub <nore...@github.com>
Date: 2024-01-16T09:42:27+01:00

dialog: don't send the BYE if dialog is in deleted state (#3714)

---

Modified: src/modules/dialog/dlg_req_within.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/695f155f3a127f0bbe220a6b44a0fc3887e1e4be.diff
Patch: 
https://github.com/kamailio/kamailio/commit/695f155f3a127f0bbe220a6b44a0fc3887e1e4be.patch

---

diff --git a/src/modules/dialog/dlg_req_within.c 
b/src/modules/dialog/dlg_req_within.c
index aab22da3c64..fb5f2e51e32 100644
--- a/src/modules/dialog/dlg_req_within.c
+++ b/src/modules/dialog/dlg_req_within.c
@@ -383,6 +383,14 @@ static inline int send_bye(struct dlg_cell *cell, int dir, 
str *hdrs)
        dlg_iuid_t *iuid = NULL;
        str lhdrs;
 
+       /* dialog is already in deleted state, nothing to do */
+       if(cell->state == DLG_STATE_DELETED) {
+               LM_WARN("dlg [%u:%u] with callid %.*s already in deleted state, 
BYE "
+                               "not sent.\n",
+                               cell->h_entry, cell->h_id, cell->callid.len, 
cell->callid.s);
+               return 0;
+       }
+
        /* Send Cancel or final response for non-confirmed dialogs */
        if(cell->state != DLG_STATE_CONFIRMED_NA
                        && cell->state != DLG_STATE_CONFIRMED) {

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

Reply via email to