Module: kamailio Branch: 5.7 Commit: d411c6ea4358e6d9dd367349e877ed5f5bf4bb2f URL: https://github.com/kamailio/kamailio/commit/d411c6ea4358e6d9dd367349e877ed5f...
Author: Federico Cabiddu federico.cabiddu@gmail.com Committer: Federico Cabiddu federico.cabiddu@gmail.com Date: 2024-01-16T09:51:14+01:00
dialog: don't send the BYE if dialog is in deleted state (#3714)
(cherry picked from commit 695f155f3a127f0bbe220a6b44a0fc3887e1e4be)
---
Modified: src/modules/dialog/dlg_req_within.c
---
Diff: https://github.com/kamailio/kamailio/commit/d411c6ea4358e6d9dd367349e877ed5f... Patch: https://github.com/kamailio/kamailio/commit/d411c6ea4358e6d9dd367349e877ed5f...
---
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) {