Module: kamailio
Branch: master
Commit: e530ad444741a2d8bddc1e6c67676282ce648456
URL:
https://github.com/kamailio/kamailio/commit/e530ad444741a2d8bddc1e6c6767628…
Author: Riccardo Villa <riccardo.villa(a)netaxis.be>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-02-11T15:57:17+01:00
dialog: add ignore_non_local_dlg parameter
---
Modified: src/modules/dialog/dialog.c
Modified: src/modules/dialog/dlg_handlers.c
Modified: src/modules/dialog/dlg_req_within.c
Modified: src/modules/dialog/doc/dialog_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/e530ad444741a2d8bddc1e6c6767628…
Patch:
https://github.com/kamailio/kamailio/commit/e530ad444741a2d8bddc1e6c6767628…
---
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index a25224318c..ddcb3b134b 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -104,6 +104,7 @@ str dlg_extra_hdrs = {NULL,0};
static int db_fetch_rows = 200;
static int db_skip_load = 0;
static int dlg_keep_proxy_rr = 0;
+int dlg_ignore_non_local_dlg = 0;
int initial_cbs_inscript = 1;
int dlg_wait_ack = 1;
static int dlg_timer_procs = 0;
@@ -327,6 +328,7 @@ static param_export_t mod_params[]={
{ "h_id_start", PARAM_INT, &dlg_h_id_start },
{ "h_id_step", PARAM_INT, &dlg_h_id_step },
{ "keep_proxy_rr", INT_PARAM, &dlg_keep_proxy_rr },
+ { "ignore_non_local_dlg", INT_PARAM, &dlg_ignore_non_local_dlg },
{ 0,0,0 }
};
diff --git a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c
index 422a714daf..dd8cef6fd8 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -71,6 +71,7 @@ extern int dlg_send_bye;
extern int dlg_event_rt[DLG_EVENTRT_MAX];
extern int dlg_wait_ack;
extern int dlg_enable_dmq;
+extern int dlg_ignore_non_local_dlg;
int spiral_detected = -1;
extern struct rr_binds d_rrb; /*!< binding to record-routing module */
@@ -1581,14 +1582,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 (dlg_ignore_non_local_dlg) {
+ if (dlg->bind_addr[0] == NULL) {
+ LM_DBG("skipping dialog without bind address\n");
+ return;
+ }
- if (lookup_local_socket(&(dlg->bind_addr[0]->sock_str)) == NULL) {
- LM_DBG("skipping non local dialog\n");
- return 0;
+ if (lookup_local_socket(&(dlg->bind_addr[0]->sock_str)) == NULL) {
+ LM_DBG("skipping non local dialog\n");
+ return;
+ }
}
/* mark dialog as expired */
diff --git a/src/modules/dialog/dlg_req_within.c b/src/modules/dialog/dlg_req_within.c
index fb81da8066..c38d2062cc 100644
--- a/src/modules/dialog/dlg_req_within.c
+++ b/src/modules/dialog/dlg_req_within.c
@@ -53,6 +53,7 @@
extern str dlg_extra_hdrs;
extern str dlg_lreq_callee_headers;
extern int dlg_ka_failed_limit;
+extern int dlg_ignore_non_local_dlg;
/**
*
@@ -452,14 +453,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 (dlg_ignore_non_local_dlg) {
+ 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;
+ 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) */
diff --git a/src/modules/dialog/doc/dialog_admin.xml
b/src/modules/dialog/doc/dialog_admin.xml
index 290e68d4d6..1850a08de6 100644
--- a/src/modules/dialog/doc/dialog_admin.xml
+++ b/src/modules/dialog/doc/dialog_admin.xml
@@ -1299,7 +1299,26 @@ modparam("dialog", "send_bye", 1)
</programlisting>
</example>
</section>
-
+ <section id="dialog.p.ignore_non_local_dlg">
+ <title><varname>ignore_non_local_dlg</varname> (int)</title>
+ <para>
+ If set to 1, don't send keepalives and
+ do nothing on timeout if dialog is non local.
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>0</quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>ignore_non_local_dlg</varname>
parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("dialog", "ignore_non_local_dlg", 1)
+...
+</programlisting>
+ </example>
+ </section>
<section id="dialog.p.wait_ack">
<title><varname>wait_ack</varname> (int)</title>
<para>