<div dir="ltr">Sorry all - I've been staring a kamailio config files for too long.<div><br></div><div>The issue was obvious when I read log messages more closely: the route[REROUTE] needed to be failure_route[REROUTE]. Everything works fine now .</div><div><br></div><div>Best,</div><div>Colin</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 24, 2016 at 3:01 PM Colin Morelli <<a href="mailto:colin.morelli@gmail.com">colin.morelli@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey all,<div><br></div><div>I'm using a combination of http_async_client and rtjson to query my API and retrieve a JSON target route set for an incoming SIP request that Kamailio will forward to. The HTTP portion of it works great. I'm able to hit my API and get back a JSON document.</div><div><br></div><div>Additionally, the rtjson parsing appears to work, because the request is hitting my freeswitch instance. However, FS is responding with a 503 (I'm intentionally doing this for testing), and Kamailio isn't calling my t_on_failure route. I've pasted the relevant portion of my config below - would be great if anyone has any insights.</div><div><br></div><div>tl;dr: the "REROUTE" route section below isn't being reached even when FS responds with a 503.</div><div><br></div><div>Best,</div><div>Colin<br><div><br></div><div><div><font face="monospace">route[ROUTING_REPLY] {</font></div><div><font face="monospace">  if $http_ok && $http_rs == 200 {</font></div><div><font face="monospace">    xlog("L_INFO", "$ci|log|loaded target route set from document $http_rb\n");</font></div><div><font face="monospace">    rtjson_init_routes("$http_rb");</font></div><div><font face="monospace">    rtjson_push_routes();</font></div><div><font face="monospace">    xlog("L_INFO", "$ci|log|attempting to relay request towards $du\n");</font></div><div><font face="monospace">    t_on_failure("REROUTE");</font></div><div><font face="monospace">    t_set_fr(0, 1000);</font></div><div><font face="monospace">    t_relay();</font></div><div><font face="monospace">  } else {</font></div><div><font face="monospace">    send_reply("480", "Temporarily Unavailable");</font></div><div><font face="monospace">  }</font></div><div><font face="monospace">}</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">route[REROUTE] {</font></div><div><font face="monospace">  xlog("L_WARN", "$ci|log|relay to destination $du failed, checking next route\n");</font></div><div><font face="monospace">  if (rtjson_next_route()) {</font></div><div><font face="monospace">    xlog("L_INFO", "$ci|log|additional route found, directing request to $du\n");</font></div><div><font face="monospace">    t_on_failure("REROUTE");</font></div><div><font face="monospace">    t_set_fr(0, 1000);</font></div><div><font face="monospace">    t_relay();</font></div><div><font face="monospace">  } else {</font></div><div><font face="monospace">    xlog("L_WARN", "$ci|log|route list exhausted, failing request\n");</font></div><div><font face="monospace">    send_reply("480", "Temporarily Unavailable");</font></div><div><font face="monospace">    exit;</font></div><div><font face="monospace">  }</font></div><div><font face="monospace">}</font></div></div></div></div></blockquote></div>