Re: Failover-Failback without any Load-Balancing
Lars Jansson via sr-users <[email protected]> Sun, 5 Apr 2026 18:48:47 +0200
| Newsgroups | gmane.comp.voip.ser |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Please have a look at the example config in the documentation for the
dispatcher module -
https://kamailio.org/docs/modules/5.8.x/modules/dispatcher.html#dispatcher.ex.config
With your current config failover to node Y will only happen if node X
responds with 503 or 408.
In the example config I refer to above you can find the failover
condition you need for the scenario when node X is down completely:
(t_branch_timeout() and !t_branch_replied())
Another thing you need to change is to add an exit; statement after the
t_relay(); statements.
Lars
Den 2026-04-03 kl. 20:41, skrev Kama User via sr-users:
> Hi.
>
> I'm trying to make failover-failback without any Load-Balancing with kamailio paired with HiPath 3800.
>
> Ubuntu 20.04, kamailio 5.5.7
>
> # dispatcher.list
> 1 sip:192.168.1.10:5060 0 0 p=primary
> 1 sip:192.168.1.11:5060 0 0 p=secondary
>
> # IP Addresses of Kamailio Server
> listen=udp:10.0.0.203:5060
> listen=tcp:10.0.0.203:5060
> listen=tls:10.0.0.203:5060
>
> # --- Module Parameters ---
> modparam("tm", "fr_timer", 10000)
> modparam("tm", "fr_inv_timer", 60000)
> modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
> modparam("dispatcher", "flags", 2)
> modparam("dispatcher", "force_dst", 1)
> modparam("dispatcher", "ds_ping_method", "OPTIONS")
> modparam("dispatcher", "ds_ping_interval", 10)
> modparam("dispatcher", "ds_probing_mode", 1) # Probes all nodes, even if inactive
> modparam("dispatcher", "ds_probing_threshold", 2)
> modparam("dispatcher", "ds_inactive_threshold", 5)
>
> # --- Routing Logic ---
> request_route {
> if (is_method("INVITE|REGISTER")) {
> if (!ds_select_dst("1", "8")) {
> sl_send_reply("503", "No servers available");
> exit;
> }
> xlog*("Selected Destination $rd/$du \n");
> t_on_failure("FAILOVER");
> t_relay();
> }
> }
>
> failure_route[FAILOVER] {
> if (t_check_status("503|408")) {
> xlog("Failed Destination $rd/$du \n");
> if (ds_next_dst()) {
> t_on_failure("FAILOVER");
> t_relay();
> }
> }
> }
>
> When both PBXs are online I check the log file and see that Selected Destination is 10.0.0.203/sip:10.0.0.65.
> I also check via sngrep: if both PBXs are up I see OPTIONS to both of them 10.0.0.65 and 10.0.0.75
>
> When I shutdown 10.0.0.65, log file says Failed Destination is 10.0.0.203/sip:10.0.0.65 and that's it.
>
> ds_next_dst not triggering at all.
>
> Thanks in advance.
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to the sender!
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!