<div dir="ltr">I've found the following in an old thread that should help me debug, I will let the list know how I get on.<div><br></div><div><div style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px">pv_printf("$var(contact)", "$xavp(contacts[0]=>uri)");</div><div style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px">xlog ("L_NOTICE", "var(contact)=$var(contact)\r\n");</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 31, 2016 at 12:46 AM, Marrold <span dir="ltr"><<a href="mailto:kamailio@marrold.co.uk" target="_blank">kamailio@marrold.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I am having some issues using get_redirects() from the UAC_Redirect module in conjunction with  t_next_contacts from the TM Module. I've searched Google and the list but the only references I can find are several years old.</div><div><br></div><div>I am attempting to configure Kamailio so it if receives a 3XX redirect message, it will store the Contacts it contains, and attempt them in 'Q' parameter order.</div><div><br></div><div>So for the Contact below-</div><div><br></div><div><div>Contact: <sip:<a href="http://10.0.97.21:5060" target="_blank">10.0.97.21:5060</a>>;q=0.2,<sip:<a href="http://5.29.13.139:5060" target="_blank">5.29.13.139:5060</a>>;q=0.5.</div></div><div><br></div><div>I want Kamailio to try 5.29.13.139, and if that times out, or is rejected in someway, try 10.0.97.21.<br></div><div><br></div><div>If I use t_relay rather than t_next_contacts, kamailio branches the calls and relays them in parallel regardless of Q value - this is not what I want.</div><div><br></div><div>If I use t_next_contacts, it attempts 5.29.13.139 which is rejected with a 401, but it doesn't attempt 5.29.13.139 and responds "408", "Request Timeout MH 2"</div><div><br></div><div>Relevant script section is below, has anyone been able to get this working?</div><div><br></div><div><div>failure_route[302] {</div><div><br></div><div>    if (t_check_status("302")){</div><div>        xlog("L_ALERT","Failure Route: 302\n$mb");</div><div><br></div><div>        get_redirects("*");</div><div>        </div><div>        if (!t_load_contacts()) {</div><div>            send_reply("500", "Server Internal Error - Cannot load contacts MH");</div><div>            exit;</div><div>        };</div><div><br></div><div>        if (!t_next_contacts()) {</div><div>            t_reply("408", "Request Timeout MH");</div><div>        } else {</div><div>            t_on_failure("302");</div><div>            t_relay();</div><div>            exit;</div><div>        };</div><div>    } else if (t_check_status("[456][0-9][0-9]")){</div><div><br></div><div>        if (!t_next_contacts()) {</div><div>            t_reply("408", "Request Timeout MH 2");</div><div>        } else {</div><div>            t_on_failure("302");</div><div>            t_relay();</div><div>            exit;</div><div>        }</div><div>    }</div><div>}</div></div><div><br></div><div>Thanks,</div><div><br></div><div>Matthew</div></div>
</blockquote></div><br></div>