Hi list, I'm using dispatcher module and I'm not able to figure it out how to accomplish a simple task regarding gateways availability and probings.
My goal is to probe with SIP OPTIONS my three gatways every, for example, 30 seconds. When one, or more, of them respond with unexpected message or simply do not respond at all, dispatcher module put it/them as inactive automatically.
I tried several conf scenarios but without success, all with gateway A off. Fore example:
1 -> I configure the three gateways (A, B and C) in conf file (sip.peers as configuration bellow) with flags 8 setted (probing destination). - When I start kamailio with probing mode equal to 1, all gateways present flags AP (using kamctl dispatcher dump) and nothing change (I only see OPTIONS sent to host B and C). - with probing mode setted to 0, all gateways start with flags AP, after 30 seconds, first OPTIONS are sent (only for B a C again), both B and C pass to AX and after more 30 seconds (ping interval defined) gateway A pass also to AX and OPTIONS stop being sent.
2-> Now I configured the gateways in conf file with flags 1 (inactive destination). - With prob mode 1, all started as IX, 30 seconds later it sends OPTIONS only for gw B and C and both change state to AP and A maintain IX. After more 30 seconds, no more OPTIONS are sent and gw A pass also to AP (hoped it remained IP or IX but not happened).
I also tried other combinations of these two parameters, but only the onde I described above make me sense for my purpose.
Maybe the solution is simple but I'm not getting there or maybe this it is only possible using failure or timeout routes and setting flags manually to gateways :(
Can anyone point out the solution for this if it exists?
module configuration used: modparam("dispatcher", "list_file", "sip.peers"); modparam("dispatcher", "flags", 2); modparam("dispatcher", "dst_avp", "$avp(AVP_DST)"); modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)"); modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)"); modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)"); modparam("dispatcher", "ds_ping_method", "OPTIONS"); modparam("dispatcher", "ds_ping_from", "sip:ping@test.tt"); modparam("dispatcher", "ds_ping_interval", 30); modparam("dispatcher", "ds_probing_threshold", 1); modparam("dispatcher", "ds_inactive_threshold", 1); modparam("dispatcher", "ds_ping_reply_codes", "class=2;class=4;class=5;class=3"); modparam("dispatcher", "ds_probing_mode", 1);
Thanks in advance, Paulo
Hi list,
problem solved. Appears that the module caught internal erros to probes so, we must be careful when using response classes instead of response codes ;)
This warning it's in the docs, but when I read it I didn't relate it with this problem.
I solved configuring the exact response codes to probes:
modparam("dispatcher", "ds_ping_reply_codes", "code=500;code=480;code=200");
Regards, Paulo
On Wed, 2018-01-17 at 14:33 +0000, Paulo Ferreira wrote:
Hi list, I'm using dispatcher module and I'm not able to figure it out how to accomplish a simple task regarding gateways availability and probings.
My goal is to probe with SIP OPTIONS my three gatways every, for example, 30 seconds. When one, or more, of them respond with unexpected message or simply do not respond at all, dispatcher module put it/them as inactive automatically.
I tried several conf scenarios but without success, all with gateway A off. Fore example:
1 -> I configure the three gateways (A, B and C) in conf file (sip.peers as configuration bellow) with flags 8 setted (probing destination).
- When I start kamailio with probing mode equal to 1, all
gateways present flags AP (using kamctl dispatcher dump) and nothing change (I only see OPTIONS sent to host B and C).
- with probing mode setted to 0, all gateways start with flags
AP, after 30 seconds, first OPTIONS are sent (only for B a C again), both B and C pass to AX and after more 30 seconds (ping interval defined) gateway A pass also to AX and OPTIONS stop being sent.
2-> Now I configured the gateways in conf file with flags 1 (inactive destination).
- With prob mode 1, all started as IX, 30 seconds later it
sends OPTIONS only for gw B and C and both change state to AP and A maintain IX. After more 30 seconds, no more OPTIONS are sent and gw A pass also to AP (hoped it remained IP or IX but not happened).
I also tried other combinations of these two parameters, but only the onde I described above make me sense for my purpose.
Maybe the solution is simple but I'm not getting there or maybe this it is only possible using failure or timeout routes and setting flags manually to gateways :(
Can anyone point out the solution for this if it exists?
module configuration used: modparam("dispatcher", "list_file", "sip.peers"); modparam("dispatcher", "flags", 2); modparam("dispatcher", "dst_avp", "$avp(AVP_DST)"); modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)"); modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)"); modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)"); modparam("dispatcher", "ds_ping_method", "OPTIONS"); modparam("dispatcher", "ds_ping_from", "sip:ping@test.tt"); modparam("dispatcher", "ds_ping_interval", 30); modparam("dispatcher", "ds_probing_threshold", 1); modparam("dispatcher", "ds_inactive_threshold", 1); modparam("dispatcher", "ds_ping_reply_codes", "class=2;class=4;class=5;class=3"); modparam("dispatcher", "ds_probing_mode", 1);
Thanks in advance, Paulo
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users