<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>read the dispatcher module docs related to ds_inactive_threshold,
      ds_ping_interval as well as tm module docs related to
      retransmission timers .. by tuning their values, you can get
      faster detection of inactive gateways.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 04.02.21 19:54, alirsm wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:0wnKhR6DTl-nacWSh7roBUj12sv8VrdHA6K2EbuRSJYQxg1RpiiQijJs2bRcWRsvO4hsouzRYd_D0o6sghHKYjTTVjlKKGQxrRX4xoQnC34=@protonmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div>Hi</div>
      <div><br>
      </div>
      <div>I have setup dispatcher failover on Kamailio 5.1 as below. If
        destination X.X.X.X is down, traffic should be routed to
        Y.Y.Y.Y.<br>
      </div>
      <div>The failover is working but every time after 30 sec Timeout.
        Is there a way to setup health check properly so the failed
        destination can be ignored while it is down?</div>
      <div><br>
      </div>
      <div>Your help is greatly appreciated,<br>
      </div>
      <div>AL</div>
      <div><br>
      </div>
      <div># dispatcher.list<br>
      </div>
      <div>1 <a class="moz-txt-link-freetext" href="sip:X.X.X.X:5060">sip:X.X.X.X:5060</a> 0 0<br>
      </div>
      <div>1 <a class="moz-txt-link-freetext" href="sip:Y.Y.Y.Y:5060">sip:Y.Y.Y.Y:5060</a> 0 0<br>
      </div>
      <div><br>
      </div>
      <div># ----- dispatcher params -----<br>
      </div>
      <div>modparam("dispatcher", "list_file",
        "/usr/local/etc/kamailio/dispatcher.list")<br>
      </div>
      <div>modparam("dispatcher", "flags", 2)<br>
      </div>
      <div>modparam("dispatcher", "ds_ping_interval", 10)<br>
      </div>
      <div>modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")<br>
      </div>
      <div>modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")<br>
      </div>
      <div>modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")<br>
      </div>
      <div>modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")<br>
      </div>
      <div>modparam("dispatcher", "ds_probing_mode", 1)<br>
      </div>
      <div>modparam("dispatcher", "ds_inactive_threshold", 4)<br>
      </div>
      <div>modparam("dispatcher", "ds_ping_latency_stats", 1)<br>
      </div>
      <div>modparam("dispatcher", "ds_probing_threshold", 1)<br>
      </div>
      <div class="protonmail_signature_block">
        <div class="protonmail_signature_block-user
          protonmail_signature_block-empty"><br>
        </div>
        <div class="protonmail_signature_block-proton"><br>
        </div>
      </div>
      <div># Dispatch requests<br>
      </div>
      <div>route[DISPATCH] {<br>
      </div>
      <div>   if(!ds_select_dst("1", "4")) {<br>
      </div>
      <div>      send_reply("503", "No destination");<br>
      </div>
      <div>      exit;<br>
      </div>
      <div>   }<br>
      </div>
      <div>   t_on_failure("DISPATCH_FAILOVER");<br>
      </div>
      <div>   route(RELAY);<br>
      </div>
      <div>   exit;<br>
      </div>
      <div>}<br>
      </div>
      <div><br>
      </div>
      <div># Failure Route</div>
      <div>failure_route[DISPATCH_FAILOVER]{<br>
      </div>
      <div>   if (t_is_canceled()) exit;<br>
      </div>
      <div>   if(!ds_next_dst()) {<br>
      </div>
      <div>      send_reply("503", "Out of gateways");<br>
      </div>
      <div>      exit;<br>
      </div>
      <div>   }<br>
      </div>
      <div>   t_on_failure("DISPATCHER_FAILOVER");<br>
      </div>
      <div>   t_relay();<br>
      </div>
      <div>}<br>
      </div>
      <div><br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
  </body>
</html>