Module: kamailio
Branch: master
Commit: 8c3b5ab3818c86b90b02e20aa4631654e0b51745
URL: https://github.com/kamailio/kamailio/commit/8c3b5ab3818c86b90b02e20aa463165…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-07-18T09:09:01+02:00
dispatcher: remove reference to MI in comments
---
Modified: src/modules/dispatcher/dispatch.c
---
Diff: https://github.com/kamailio/kamailio/commit/8c3b5ab3818c86b90b02e20aa463165…
Patch: https://github.com/kamailio/kamailio/commit/8c3b5ab3818c86b90b02e20aa463165…
---
diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c
index 287164f829d..bdb615ad3ea 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -3982,14 +3982,14 @@ static void ds_options_callback(
}
}
- /* Check if in the meantime someone disabled probing of the target through RPC, MI or reload */
+ /* Check if in the meantime someone disabled probing of the target
+ * through RPC or reload */
if(ds_probing_mode == DS_PROBE_ONLYFLAGGED
&& !(ds_get_state(group, &uri) & DS_PROBING_DST)) {
return;
}
/* ps->code contains the result-code of the request.
- *
* We accept both a "200 OK" or the configured reply as a valid response */
if((ps->code >= 200 && ps->code <= 299)
|| ds_ping_check_rplcode(ps->code)) {
@@ -4000,7 +4000,7 @@ static void ds_options_callback(
&& (ds_get_state(group, &uri) & DS_PROBING_DST)))
state |= DS_PROBING_DST;
- /* Check if in the meantime someone disabled the target through RPC or MI */
+ /* Check if in the meantime someone disabled the target through RPC */
if(!(ds_get_state(group, &uri) & DS_DISABLED_DST)
&& ds_update_state(fmsg, group, &uri, state, &rctx) != 0) {
LM_ERR("Setting the state failed (%.*s, group %d)\n", uri.len,
@@ -4010,7 +4010,7 @@ static void ds_options_callback(
state = DS_TRYING_DST;
if(ds_probing_mode != DS_PROBE_NONE)
state |= DS_PROBING_DST;
- /* Check if in the meantime someone disabled the target through RPC or MI */
+ /* Check if in the meantime someone disabled the target through RPC */
if(!(ds_get_state(group, &uri) & DS_DISABLED_DST)
&& ds_update_state(fmsg, group, &uri, state, &rctx) != 0) {
LM_ERR("Setting the probing state failed (%.*s, group %d)\n",
Situation: Two Kamailio nodes syncing dialog profiles via DMQ
Observation: When a dialog timeout is encountered, about half of the time, the timeout is triggered on the peer node not handling the dialog preventing the call to be correctly terminated and also leaving entries in the dialog database which never get deleted.
https://kamailio.org/docs/modules/5.7.x/modules/dialog.html#dialog.p.enable…
Makes clear, that only the node which is handling the dialog in question, can make changes not related to the dialog profiles. So when a dialog times out, it is this node which has to trigger the timeout, not any other one.
When looking at the source code, it is clear, that the 'lifetime' is transmitted via DMQ dialog message to the peer nodes, which in turn arm a timer. So it is obvious, this time will trigger, sometimes before the instance handling the dialog itself triggers that timer.
With some assistance of @oej I found a way to alter the JSON payload to extend the lifetime on the peer nodes:
```
route[DMQ_CAPTURE]
{
if(is_method("KDMQ"))
{
if(has_body("application/json") && $fU == 'dialog')
{
if (jansson_get("lifetime", $rb, "$var(lifetime)"))
{
$var(new_lifetime) = $var(lifetime) + 60; # Add 60 seconds on DMQ peer to make sure it expires AFTER main node.
$var(newrb) = $rb;
jansson_set("integer", "lifetime", $var(new_lifetime), "$var(newrb)");
set_body("$var(newrb)","application/json");
msg_apply_changes();
}
}
dmq_handle_message();
exit;
}
}
```
Testing with this config fixed the issue of the timeout firing on a peer node instead of the node handling the dialog.
Issue is present in 5.5, 5.6 and after looking at the code, I assume also on 5.7
-Benoît
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3656
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3656(a)github.com>
Module: kamailio
Branch: master
Commit: ba31a0065af34490650a205738328f52b95a784b
URL: https://github.com/kamailio/kamailio/commit/ba31a0065af34490650a205738328f5…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2024-07-16T10:31:11+02:00
modules: readme files regenerated - dispatcher ... [skip ci]
---
Modified: src/modules/dispatcher/README
---
Diff: https://github.com/kamailio/kamailio/commit/ba31a0065af34490650a205738328f5…
Patch: https://github.com/kamailio/kamailio/commit/ba31a0065af34490650a205738328f5…
---
diff --git a/src/modules/dispatcher/README b/src/modules/dispatcher/README
index 41f9d7bb812..16c10332df7 100644
--- a/src/modules/dispatcher/README
+++ b/src/modules/dispatcher/README
@@ -1883,6 +1883,7 @@ kamctl rpc dispatcher.hash 4 bob server.com
startup, useful when the hostname of the destination address
is a NAPTR or SRV record only. Such addresses cannot be
matched anymore with ds_is_from_list(...).
+ + 32 (bit at index 5 - 1 <<5) - no ping to destination
* priority: sets the priority in destination list (based on it is
done the initial ordering inside the set)
* attributes: extra fields in form of name1=value1;...;nameN=valueN.
Module: kamailio
Branch: master
Commit: abdd0bfaf6a2e50fb96e2f522f03a65f331b57b5
URL: https://github.com/kamailio/kamailio/commit/abdd0bfaf6a2e50fb96e2f522f03a65…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-07-16T10:10:06+02:00
dispatcher: new flag 32 to not send ping to destination
---
Modified: src/modules/dispatcher/dispatch.c
Modified: src/modules/dispatcher/dispatch.h
---
Diff: https://github.com/kamailio/kamailio/commit/abdd0bfaf6a2e50fb96e2f522f03a65…
Patch: https://github.com/kamailio/kamailio/commit/abdd0bfaf6a2e50fb96e2f522f03a65…
---
diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c
index d36141bbafd..287164f829d 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -4069,6 +4069,9 @@ void ds_ping_set(ds_set_t *node)
/* skip addresses set in disabled state by admin */
if((node->dlist[j].flags & DS_DISABLED_DST) != 0)
continue;
+ /* skip addresses with no-ping flag */
+ if((node->dlist[j].flags & DS_NOPING_DST) != 0)
+ continue;
/* If the Flag of the entry has "Probing set, send a probe: */
if(ds_ping_result_helper(node, j)) {
LM_DBG("probing set #%d, URI %.*s\n", node->id,
diff --git a/src/modules/dispatcher/dispatch.h b/src/modules/dispatcher/dispatch.h
index 06410225a62..cf1842aeb47 100644
--- a/src/modules/dispatcher/dispatch.h
+++ b/src/modules/dispatcher/dispatch.h
@@ -46,7 +46,8 @@
#define DS_DISABLED_DST 4 /*!< admin disabled destination */
#define DS_PROBING_DST 8 /*!< checking destination */
#define DS_NODNSARES_DST 16 /*!< no DNS A/AAAA resolve for host in uri */
-#define DS_STATES_ALL 31 /*!< all bits for the states of destination */
+#define DS_NOPING_DST 32 /*!< no ping to destination */
+#define DS_STATES_ALL 63 /*!< all bits for the states of destination */
#define ds_skip_dst(flags) ((flags) & (DS_INACTIVE_DST|DS_DISABLED_DST))