<p dir="ltr">Hi,</p>
<p dir="ltr">You describe what you are trying to achieve, but not the result you are seeing.</p>
<p dir="ltr">One thing I noticed is that in your failure route you set t_on_failure("DISPATCH"), but should it not be t_on_failure("RTF_DISPATCH")?</p>
<p dir="ltr">Regards,</p>
<p dir="ltr">Charles<br>
</p>
<div class="gmail_quote">On 14 Sep 2013 08:33, "Joseph Watson" <<a href="mailto:joseph.watson@veranetworks.com">joseph.watson@veranetworks.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello Everyone,<div><br></div><div>I am really having an issue getting kamailio to try another dispatch route when I get a 500 back from one of my freeswitch servers.</div><div><br></div><div>Currently I have a list of freeswitch servers located in my dispatch.list file. If one of then is to busy it will respond with a 500 Maximum Call in Progress. I am trying to get Kamailio to go to the next route in the dispatch.list when it get one of these 503 and if it should exhaust the whole list respond with a 503. Here is my kamailio config</div>

<div><br></div><div><br></div><div>####### Global Parameters #########</div><div><br></div><div>#!ifdef WITH_DEBUG</div><div>debug=4</div><div>log_stderror=yes</div><div>#!else</div><div>debug=4</div><div>log_stderror=yes</div>

<div>#!endif</div><div><br></div><div>memdbg=5</div><div>memlog=5</div><div><br></div><div>log_facility=LOG_LOCAL0</div><div><br></div><div>fork=yes</div><div>children=10</div><div><br></div><div>/* comment the next line to enable TCP */</div>

<div>disable_tcp=yes</div><div><br></div><div>/* uncomment the next line to disable the auto discovery of local aliases</div><div>   based on revers DNS on IPs (default on) */</div><div>auto_aliases=no</div><div><br></div>

<div>/* uncomment and configure the following line if you want Kamailio to<br></div><div>   bind on a specific interface/port/proto (default bind on all available) */</div><div><div>listen=udp:eth0:5060</div><div><br></div>

</div><div>sip_warning=no</div><div><br></div><div>####### Modules Section ########</div><div><br></div><div>#set module path</div><div>mpath="/usr/local/lib64/kamailio/modules_k/:/usr/local/lib64/kamailio/modules/"</div>

<div><br></div><div>loadmodule "mi_fifo.so"</div><div>loadmodule "kex.so"</div><div>loadmodule "tm.so"</div><div>loadmodule "tmx.so"</div><div>loadmodule "sl.so"</div><div>

loadmodule "rr.so"</div><div>loadmodule "pv.so"</div><div>loadmodule "maxfwd.so"</div><div>loadmodule "textops.so"</div><div>loadmodule "siputils.so"</div><div>loadmodule "xlog.so"</div>

<div>loadmodule "sanity.so"</div><div>loadmodule "ctl.so"</div><div>loadmodule "mi_rpc.so"</div><div>loadmodule "acc.so"</div><div>loadmodule "dispatcher.so"</div><div><br>

</div><div><br></div><div># ----------------- setting module-specific parameters --------------- </div><div><br></div><div><div># ----- mi_fifo params -----</div><div>modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")</div>

<div><br></div><div>modparam("xlog", "buf_size", 8192)</div><div><br></div><div># ----- rr params -----</div><div># add value to ;lr param to cope with most of the UAs</div><div>modparam("rr", "enable_full_lr", 1)</div>

<div># do not append from tag to the RR (no need for this script)</div><div>modparam("rr", "append_fromtag", 0)</div><div><br></div><div><br></div><div># ----- acc params -----</div><div>modparam("acc", "log_flag", 1)</div>

<div>modparam("acc", "failed_transaction_flag", 3)</div><div>modparam("acc", "log_extra", "src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;src_ip=$si")</div>

<div><br></div><div># ----- tm params -----</div><div>modparam("tm", "fr_timer", 2000)</div><div>modparam("tm", "fr_inv_timer", 40000)</div><div>modparam("tm", "remap_503_500", 0)</div>

<div><br></div><div># ----- dispatcher params -----</div><div>modparam("dispatcher", "list_file", "/usr/local/etc/kamailio/dispatcher.list")</div><div>modparam("dispatcher", "flags", 2)</div>

<div>modparam("dispatcher", "dst_avp", "$avp(i:271)")</div><div>modparam("dispatcher", "grp_avp", "$avp(i:272)")</div><div>modparam("dispatcher", "cnt_avp", "$avp(i:273)")</div>

<div><br></div><div>#modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")</div><div>#modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")</div><div>#modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")</div>

<div>#modparam("dispatcher", "ds_append_branch", 1)</div><div>####### Routing Logic ########</div><div><br></div><div><br></div><div># main request routing logic</div><div><br></div><div>route {</div>
<div>
        append_hf("X-VSIP-CUST-IP: $si\r\n");</div><div>        route(DISPATCH);</div><div><br></div><div>        route(RELAY);</div><div>}</div><div><br></div><div># Dispatch requests</div><div>route[DISPATCH] {</div>

<div>        # round robin dispatching on gateways group '1'</div><div>        if(!ds_select_dst("1", "4"))</div><div>        {</div><div>                send_reply("404", "No destination");</div>

<div>                exit;</div><div>        }</div><div>#       xlog("L_DBG", "--- SCRIPT: going to <$ru> via <$du>\n");</div><div>        t_on_failure("RTF_DISPATCH");</div><div>

        return;</div><div>}</div><div><br></div><div># Sample failure route</div><div>failure_route[RTF_DISPATCH] {</div><div>        if (t_is_canceled()) {</div><div>                exit;</div></div><div><div>        }</div>

<div>        # next DST - only for 500 or local timeout</div><div>        if (t_check_status("500") or (t_branch_timeout() and !t_branch_replied()))</div><div>        {</div><div>                if(ds_next_dst())</div>

<div>                {</div><div>                        t_on_failure("DISPATCH");</div><div>                        route(RELAY);</div><div>                        exit;</div><div>                }</div><div>        }</div>

<div>}</div><div><br></div><div>route[RELAY] {</div><div><span style="white-space:pre-wrap">    </span>if (!t_relay()) {</div><div>                send_reply("503", "LB01 - All Circuits Are Busy");</div>

<div>#               sl_reply_error();</div><div>        }</div><div>        exit;</div><div>}</div></div><div><br></div><div>I am very new to kamailio and still learning my way around. Any help you can provide with be fantastic!</div>

<div><br></div><div>Thank you,</div><div>Joe Watson</div><div><br></div></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div>

<br>
<font face="Helvetica, Arial, sans-serif"><font size="2"><span style="font-size:10pt"><a href="http://www.sipcentric.com/" title="blocked::http://www.sipcentric.com/" target="_blank">www.sipcentric.com</a><br>
            <br>
            Follow us on twitter <a href="http://twitter.com/sipcentric" title="blocked::http://twitter.com/sipcentric" target="_blank">@sipcentric</a><br>
            <br>
            <font color="gray">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font> <font color="gray">Registered
                office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.</font></span></font></font>