Module: kamailio
Branch: 5.2
Commit: 01d814b824c5b03a044f793783bd9ab7a9d811c3
URL: 
https://github.com/kamailio/kamailio/commit/01d814b824c5b03a044f793783bd9ab7a9d811c3

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2020-09-14T09:34:56+02:00

dispatcher: update state if sending keepalive OPTIONS fails

- backport of 4584e17b98f338916cc89dac6e1700f250cdf501

(cherry picked from commit 1bccb817c20f02665d48a38eb59a57a6ae17b81f)

---

Modified: src/modules/dispatcher/dispatch.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/01d814b824c5b03a044f793783bd9ab7a9d811c3.diff
Patch: 
https://github.com/kamailio/kamailio/commit/01d814b824c5b03a044f793783bd9ab7a9d811c3.patch

---

diff --git a/src/modules/dispatcher/dispatch.c 
b/src/modules/dispatcher/dispatch.c
index 77294c7782..23625e87d1 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -3095,6 +3095,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;
@@ -3144,6 +3145,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);
+                               }
                        }
                }
        }


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to