Version 1.3
I have modified dispatch.c to probe all current gateways in the dispatcher list. If a probe fails or times out the gateway is put into "probing" mode where it is no longer active and won't be chosen from the destination list. On the other hand if a probe succeeds the gateway is put into "active" mode and will be available in the list.
By setting the ds_ping_interval you are essentially forcing openSER to probe each gateway at that interval. The code modification was minimal and goes a long way past probing only the failed gateways.
ds_is_from_list() has been modified to return true only if that gateway is in the list AND not "probing". This function was modified to allow me to use database driven intelligent load balancing for call distribution and to double check the database chosen destination against the internal dispatcher list to be certain the gateway is available. So:
avp_pushto("$duri", "$var(dStr)");
if (ds_is_from_list())
... the gatey is up
else
... the gateway is down check DB again
ds_options_callback() has been modified to set a gateway to probing in case a probe fails or times out.
ds_check_timer() has been modified to probe all gateways, not just the ones in "probing" state.
If implemented in a future release I would suggest adding some options that allow the user to probe only failed gateways, as in the current release, or all gateways as in my modification.
modified dispatch.c
Logged In: YES
user_id=337916
Originator: NO
Moved to patches section.
Logged In: YES
user_id=7341
Originator: NO
If this is going in, we need an update for the documentation too.
Logged In: YES
user_id=1246013
Originator: NO
Re-worked version committed to svn. the part for ds_is_from_list() is broken. I will see what can be done before the release freeze in this aspect.