Hey all,
I've got two layers of Kamailio proxies running. One set of edge proxies that are parking outbound connections and doing load balancing to a set of registrar/proxies. This is working well with one exception:
I can't seem to get t_load_contacts/t_next_contacts working correctly for handling multiple outbound connections. It *appears* to work (though I haven't extensively tested) whenever there's more than one registration binding for an AOR. However, when there's only one, I get:
8(27) DEBUG: tm [t_serial.c:191]: t_load_contacts(): nr_branches is 0 8(27) DEBUG: tm [t_serial.c:194]: t_load_contacts(): nothing to do - only one contact! 8(27) DEBUG: tm [t_serial.c:455]: t_next_contacts(): no contacts in contacts_avp - we are done! 8(27) ERROR: <script>: t_next_contacts() failed
I tried omitting the call to t_next_contacts(), thinking it should possibly only be used in failure_route. But when I do that (while leaving t_load_contacts), I get:
5(24) ERROR: tm [t_fwd.c:1730]: t_forward_nonack(): ERROR: t_forward_nonack: no branches for forwarding 5(24) WARNING: <core> [receive.c:258]: receive_msg(): error while trying script
The relevant part of the config is:
if (!lookup("location")) { $var(rc) = $rc; switch ($var(rc)) { case -1: xlog("L_INFO", "$ci|log|lookup of contacts for $ru returned no results\r\n"); send_reply("404", "Not Found"); exit; case -3: xlog("L_INFO", "$ci|log|lookup of contacts for $ru failed with code $var(rc)\r\n"); send_reply("404", "Not Found"); exit; case -2: send_reply("405", "Method Not Allowed"); exit; } }
if (!t_load_contacts() || !t_next_contacts()) { xlog("L_ERR", "t_load_contacts() failed\n"); sl_reply_error(); t_release(); exit; }
Am I missing something else here? Note: it works fine if I remove t_load_contacts/t_next_contacts, but then I don't get proper handling of multiple sip.instance bindings/differing q values.
Best, Colin