Module: kamailio
Branch: master
Commit: 65a442a2ab5fce1a469bc7ac5ec7f9880f4dae7e
URL: https://github.com/kamailio/kamailio/commit/65a442a2ab5fce1a469bc7ac5ec7f98…
Author: root <root(a)sipproxy1.evolvetsi.local>
Committer: root <root(a)sipproxy1.evolvetsi.local>
Date: 2015-08-24T14:29:23-04:00
dispatcher: add new probing_mode=3 to always probe flagged gateways
- added DS_PROBE_ONLYFLAGGED probing_mode option. If set,
any gateways with a state of PROBING will be continually
probed and the PROBING flag will never be cleared. This
allows probing specific gateways continually, keeping
their up/down status current.
---
Modified: modules/dispatcher/README
Modified: modules/dispatcher/dispatch.c
Modified: modules/dispatcher/dispatch.h
---
Diff: https://github.com/kamailio/kamailio/commit/65a442a2ab5fce1a469bc7ac5ec7f98…
Patch: https://github.com/kamailio/kamailio/commit/65a442a2ab5fce1a469bc7ac5ec7f98…
---
diff --git a/modules/dispatcher/README b/modules/dispatcher/README
index 281ca85..275de03 100644
--- a/modules/dispatcher/README
+++ b/modules/dispatcher/README
@@ -688,8 +688,14 @@ Note
Controls what gateways are tested to see if they are reachable. If set
to 0, only the gateways with state PROBING are tested; if set to 1, all
gateways are tested; if set to 2, only gateways in inactive state with
- probing mode set are tested. If set to 1 and there is a failure of
- keepalive to an active gateway, then it is set to TRYING state.
+ probing mode set are tested.
+
+ If set to 3, any gateway with a PROBING state is continually probed without
+ modifying/removing the PROBING state flag. This allows selected gateways to
+ be probed continually, regardless of state chagnes.
+
+ If set to 1 and there is a failure of keepalive to an active gateway, then it
+ is set to TRYING state.
Default value is "0".
diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c
index 4a7bf81..1cc3470 100644
--- a/modules/dispatcher/dispatch.c
+++ b/modules/dispatcher/dispatch.c
@@ -2753,8 +2753,10 @@ static void ds_options_callback( struct cell *t, int type,
{
/* Set the according entry back to "Active" */
state = 0;
- if (ds_probing_mode==DS_PROBE_ALL)
+ if (ds_probing_mode==DS_PROBE_ALL ||
+ (ds_probing_mode == DS_PROBE_ONLYFLAGGED && 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 */
if (!(ds_get_state(group, &uri) & DS_DISABLED_DST) && ds_update_state(fmsg, group, &uri, state) != 0)
{
diff --git a/modules/dispatcher/dispatch.h b/modules/dispatcher/dispatch.h
index 9091155..56da6c7 100644
--- a/modules/dispatcher/dispatch.h
+++ b/modules/dispatcher/dispatch.h
@@ -48,6 +48,7 @@
#define DS_PROBE_NONE 0
#define DS_PROBE_ALL 1
#define DS_PROBE_INACTIVE 2
+#define DS_PROBE_ONLYFLAGGED 3
#define DS_MATCH_ALL 0
#define DS_MATCH_NOPORT 1