[OpenSIPS-Users] using load balancer and lookup together
Michael Vale
masked at vale.ski
Sun Apr 5 05:33:46 EST 2020
hi,
perhaps this can be solved with a failure route and or a check status
but i dont know and it would be nice if i could do it without it.
no matter how i write the script, either a uac to uac call goes to the
load balancer or the load balancer is stuck with a 404 reply from the
script or uac to uac works but when one end is not registered it goes
to the load balancer instead of getting a 404.
i've tried failure routes and get the same problem. here is a snippet.
if (!lb_start(1,"pstn")) && (!lookup("location","m",)) {
lb_disable_dst();
#route(relay);
#send_reply(404,"No user or gateway");
if (lb_start(1,"pstn")) {
send_reply(500,"SIPSIPSIPS");
# t_relay();
exit;
}
# exit;
} else if (lookup("location","m")) &&
(!lb_start(1,"pstn")) {
lb_disable_dst();
route(relay);
exit;
} else if (lb_start(1,"pstn")) &&
(lookup("location","m")) {
lb_disable_dst();
route(relay);
exit;
} else if (!lookup("location","m")) &&
(!lb_start(1,"pstn")) {
send_reply(404,"Not Found");
exit;
} else if (lb_start(1,"pstn")) &&
(!lookup("location","m")) {
# #lb_disable_dst();
if (!lookup("location","m")) {
route(relay);
exit;
}
if (lookup("location","m")) {
lb_disable_dst();
route(relay);
exit;
}
}
thanks in advance,
michael.
More information about the Users
mailing list