From f8398d937611c692f87ccc0ddc284442acbf1893 Mon Sep 17 00:00:00 2001 From: Riccardo Villa Date: Thu, 10 Feb 2022 18:00:48 +0100 Subject: [PATCH] dialog: don't sent ka if dialog is not local --- src/modules/dialog/dlg_req_within.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/modules/dialog/dlg_req_within.c b/src/modules/dialog/dlg_req_within.c index 809834527ff..fb81da80667 100644 --- a/src/modules/dialog/dlg_req_within.c +++ b/src/modules/dialog/dlg_req_within.c @@ -452,6 +452,16 @@ int dlg_send_ka(dlg_cell_t *dlg, int dir) int result; dlg_iuid_t *iuid = NULL; + if (dlg->bind_addr[dir] == NULL) { + LM_DBG("skipping dialog without bind address\n"); + return 0; + } + + if (lookup_local_socket(&(dlg->bind_addr[dir]->sock_str)) == NULL) { + LM_DBG("skipping non local dialog\n"); + return 0; + } + /* do not send KA request for non-confirmed dialogs (not supported) */ if (dlg->state != DLG_STATE_CONFIRMED) { LM_DBG("skipping non-confirmed dialogs\n");