From 1bccb817c20f02665d48a38eb59a57a6ae17b81f Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 14 Sep 2020 09:33:16 +0200 Subject: [PATCH] dispatcher: update state if sending keepalive OPTIONS fails - backport of 4584e17b98f338916cc89dac6e1700f250cdf501 --- src/modules/dispatcher/dispatch.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c index d66a48e9196..aa563a984ba 100644 --- a/src/modules/dispatcher/dispatch.c +++ b/src/modules/dispatcher/dispatch.c @@ -3252,6 +3252,7 @@ void ds_ping_set(ds_set_t *node) uac_req_t uac_r; int i, j; str ping_from; + int state; if(!node) return; @@ -3300,6 +3301,18 @@ void ds_ping_set(ds_set_t *node) < 0) { LM_ERR("unable to ping [%.*s]\n", node->dlist[j].uri.len, node->dlist[j].uri.s); + state = DS_TRYING_DST; + if(ds_probing_mode != DS_PROBE_NONE) { + state |= DS_PROBING_DST; + } + /* check if meantime someone disabled the target via RPC */ + if(!(node->dlist[j].flags & DS_DISABLED_DST) + && ds_update_state(NULL, node->id, &node->dlist[j].uri, + state) != 0) { + LM_ERR("Setting the probing state failed (%.*s, group %d)\n", + node->dlist[j].uri.len, node->dlist[j].uri.s, + node->id); + } } } }