Hello,
I am facing an issue with kamailio carrierroute.I have a setup where
multiple asterisk is behind a kamailio server.I am able to dispatch the
load by using carrierroute.
Its working perfectly for retail users.But problem is its not working for
wholesale users.I am attaching the dump for wholesale client.
here is a little descrption for the shark:-
192.151.149.102 is the wholesale client ip.
46.166.139.60:4848 is kamailio server.
46.166.139.60:3628 is asterisk server.
when 192.151.149.102 sends invite to 46.166.139.60:4848 [Kamailio] we are
getting 401. [dump2.pcap]
when 192.151.149.102 sends invite to 46.166.139.60:3628 [Direct Asterisk ]
we are getting 200. [dump.pcap]
here is the code i am using for load balancing:-
route[Carrer] {
#!ifdef WITH_CARRIERROUTE
if (!cr_route("default", "default", "$rU",
"$rU",
"call_id")) {
xlog("L_ERR", "cr_route failed\n");
exit;
}
#!endif
$avp(s:host)= $rd+":"+$rp;
t_on_failure("1");
if (!t_relay()) {
sl_reply_error();
};
}
failure_route[1] {
revert_uri();
#!ifdef WITH_CARRIERROUTE
if (!cr_next_domain("default", "default", "$rU",
"$avp(s:host)", "$T_reply_code",
"$avp(s:domain)"))
{
xlog("L_ERR", "cr_next_domain failed\n");
exit;
}
if (!cr_route("default", "default", "$rU",
"$rU",
"call_id")) {
xlog("L_ERR", "cr_route failed\n");
}
t_on_failure("1");
route(NASIR);
exit;
#!endif
$avp(s:host)= $rd+":"+$rp;
if (!t_relay()) {
xlog("L_ERR", "t_relay failed-custom\n");
exit;
};
}