<div dir="ltr"><div><div><div><div><div><div>Hello List,<br><br></div>I'm finishing my implementation of LCR with kamailio for outgoing calls but one use case does not work.<br></div>Let me explain:<br></div>- I have some sbc for one destination. If one destination fail, kamailio try to second one etc..<br></div>- If no SBC is available for this destination (for exemple, all are down), i want to send my call to an error server (asterisk), play an error sound.<br><br></div>To accomplish this, i re-write the RURI: "sip:error1@errorserver.local", and launch RELAY route. But kamailio dont make a DNS query to find IP of "errorserver.local", only change RURI and try to send to the last LCR gateway.<br><br></div>I have also try to add a new branch, but same result... Why kamailio do not make a new DNS query ?<br><i><br>route[RELAY] {<br>        #if (is_method("INVITE")) {<br>        #       if(!t_is_set("failure_route")) t_on_failure("MANAGE_FAILURE");<br>        #}<br><br>        if (!t_relay()) {<br>                sl_reply_error();<br>        }<br>        exit;<br>}<br><br><br>route[NOTFOUND]{<br>        $ru = "sip:error1@errorserver.local";<br>        xlog("L_WARN", "[$ci]|$si|Routing this call to $ru (error server)\n");<br>        append_branch($ru);<br>        route(RELAY);<br>}<br><br><br>route[LCR] {<br>        xlog("L_INFO", "[$ci]|$si|Loading gateways...\n");<br>        if (!load_gws(1)) {<br>                xlog("L_ERR", "[$ci]|$si|Can't load LCR gateways\n");<br>                sl_send_reply("503", "Unable to load gateways");<br>                exit;<br>        } else {<br>                $var(i) = 0;<br>                while(is_avp_set("$(avp(i:709)[$var(i)])")) {<br>                        xlog("L_INFO", "[$ci]|$si|This gateway was found: gw_uri_avp[$var(i)]=$(avp(i:709)[$var(i)]) \n");<br>                        $var(i) = $var(i) + 1;<br>                };<br><br>                if(is_avp_set("$avp(i:709)")) {<br>                        xlog("L_INFO", "[$ci]|$si|Trying gateway ‘$avp(i:709)’\n");<br>                } else {<br>                        xlog("L_INFO", "[$ci]|$si|No more gateways. Goto route NOTFOUND...\n");<br>                        route(NOTFOUND);<br>                };<br><br>                # try the first matched gateway<br>                if (next_gw()) {<br>                        xlog("L_INFO", "[$ci]|$si|New request URI built: $ru . Relaying it (and arming backup destination if needed).");<br>                        # Route to failure for failover<br>                        t_on_failure("lcrfailure");<br>                        route(RELAY);<br>                } else {<br>                        xlog("L_INFO", "[$ci]|$si|No more gateways (after next_gw()). Goto route NOTFOUND...");<br>                        route(NOTFOUND);<br>                };<br>        };<br>        exit;<br>}<br><br>failure_route[lcrfailure] {<br><br>        # the previous gateway is no good<br>        if (t_check_status("408|50[34]")) {<br>                xlog("L_WARN", "[$ci]|$si|Entering in entering failure_route[lcrfailure]. Error code: $T_reply_code \n");<br>                if(is_avp_set("$avp(i:709)")) {<br>                        xlog("L_INFO", "[$ci]|$si|Trying gateway ‘$avp(i:709)’\n");<br>                } else {<br>                        xlog("L_ERR", "[$ci]|$si|AVP is not set\n");<br>                };<br><br>                if (next_gw()) {<br>                        xlog("L_INFO", "[$ci]|$si|New request URI built: $ru . Relaying it (and arming backup destination if needed).");<br>                        # Route to failure for failover<br>                        t_on_failure("lcrfailure");<br>                        route(RELAY);<br>                } else {<br>                        xlog("L_INFO", "[$ci]|$si|No more gateways (after next_gw()). Goto route NOTFOUND...");<br>                        route(NOTFOUND);<br>                };<br>        exit;<br>        };<br>}</i><br><br><div>Many thanks,<br></div><div>Regards.<br></div><div><br></div></div>