From 79c4c7d0c4de2b15c68e07380a106544f2e27dbe Mon Sep 17 00:00:00 2001 From: Riccardo Villa Date: Thu, 10 Feb 2022 18:00:18 +0100 Subject: [PATCH] dialog: don't do nothing on timeout if dialog is not local --- src/modules/dialog/dlg_handlers.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c index 3f8adefb795..422a714daf5 100644 --- a/src/modules/dialog/dlg_handlers.c +++ b/src/modules/dialog/dlg_handlers.c @@ -1581,6 +1581,16 @@ void dlg_ontimeout(struct dlg_tl *tl) dlg = ((struct dlg_cell*)((char *)(tl) - (unsigned long)(&((struct dlg_cell*)0)->tl))); + if (dlg->bind_addr[0] == NULL) { + LM_DBG("skipping dialog without bind address\n"); + return 0; + } + + if (lookup_local_socket(&(dlg->bind_addr[0]->sock_str)) == NULL) { + LM_DBG("skipping non local dialog\n"); + return 0; + } + /* mark dialog as expired */ dlg->dflags |= DLG_FLAG_EXPIRED;