<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto"><span style="font-family:Arial">Dear List,</span><br />
<br />
<span style="font-family:Arial">We’re using Kamailio to load balance MRCP requests to multiple backend groups with a configuration as follows:</span><br />
<br />
<span style="font-family:Andale Mono"># kamailio.cfg</span><br />
<span style="font-family:Andale Mono">...</span><br />
<span style="font-family:Andale Mono">...</span><br />
<span style="font-family:Andale Mono">route[DISPATCH] {</span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">    if($ua=="mrcp_backend_1") {</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">            if(!ds_select_dst("1", "4")) {</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">                    send_reply("404", "No destination");</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">                       exit;</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">            }</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">    }</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">    if($ua=="mrcp_backend_2") {</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">            if(!ds_select_dst("2", "4")) {</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">                    send_reply("404", "No destination");</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">                    exit;</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">            }</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">    }</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">    xlog("L_DBG", "--- SCRIPT: going to <$ru> via <$du>\n");</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">    t_on_failure("RTF_DISPATCH");</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">    route(RELAY);</span></span><br />
<span style="font-family:Andale Mono"><span style="white-space:pre">    exit;</span></span><br />
<span style="font-family:Andale Mono">}</span><br />
<span style="font-family:Andale Mono">...</span><br />
<span style="font-family:Andale Mono">...</span><br />
<br />
<span style="font-family:Andale Mono"># dispatcher.list</span><br />
<span style="font-family:Andale Mono">1 sip:mrcp01.server.int:8060;transport=tcp</span><br />
<span style="font-family:Andale Mono">1 sip:mrcp02.server.int:8060;transport=tcp</span><br />
<br />
<span style="font-family:Andale Mono">2 sip:mrcp03.server.int:8060;transport=tcp</span><br />
<span style="font-family:Andale Mono">2 sip:mrcp04.server.int:8060;transport=tcp</span><br />
<br />
With this configuration, Kamailio load balances the initial SIP INVITE among the MRCP servers. After the INVITE, the service communicates directly to the MRCP servers via SIP (for hanging up the call), MRCPv2 (for sending speech control messages), and RTP (for sending audio).<br />
<br />
We would like to implement a configurable number of retries, so that if a particular backend times out, Kamailio would retry X times to other backend(s). In short, <a href="https://cbonte.github.io/haproxy-dconv/2.4/configuration.html#4-retries" target="_blank">something equivalent to HAProxy’s retries</a>, but for Kamailio. This probably implies having Kamailio always as part of our communication (not just load balancing the initial SIP INVITE).<br />
<br />
I haven’t been able to find much information about this, could someone provide some pointers?<br />
<br />
Thank you so much</div>
</div>
<div name="messageSignatureSection"><br />
<div class="matchFont">With best wishes,
<div dir="auto">Unai Rodriguez</div>
</div>
</div>
</body>
</html>