[OpenSIPS-Users] using load balancer and lookup together

Michael Vale masked at vale.ski
Sun Apr 5 13:54:29 EST 2020


Ok, to explain,
Using your logic,
To call say '555' will goto Voicemail, if I disable voicemail it will
return a 404 instead of going to the load balancer.
That's fine, if 555 is an extension, but if it's (for this example) a
PSTN number (or a all-else catch all, like I'm trying to achieve) thats
not OK because I get a 404 rather than it getting routed to the load
balancer.
If 555 is an extension/user the call will go through to the registered
extension, but if it's not registered in the usrloc table, it goes to
404, instead of the load balancer.
If I reverse the logic, It will goto the load balancer even if it's a
registered extension, or Too Many Hops, depending on how I adjust the
logic.
I cannot seem to create a catch all for non-usrloc registered extension
calls to goto the load balancer otherwise return a 404.
I hope I explained it well enough. I will keep trying,
Regards,
Michael.
On Sun, 2020-04-05 at 11:47 +0100, David Villasmil wrote:
> Why are you trying to do all at once?
> 
> Why not first do the lookup 
> 
> https://github.com/davidcsi/kamailio-private-public/blob/a81d7f777a8c5ee2dbb32311f7e6b5a3cf94bf32/kamailio.cfg#L771
> 
> 
> and then start load balancing?
> 
> https://github.com/davidcsi/kamailio-private-public/blob/a81d7f777a8c5ee2dbb32311f7e6b5a3cf94bf32/kamailio.cfg#L1109
> 
> Do you have some special need to fulfill?
> 
> David
> On Sun, 5 Apr 2020 at 06:34, Michael Vale via Users <
> users at lists.opensips.org> wrote:
> > 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.
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > 
> > Users mailing list
> > 
> > Users at lists.opensips.org
> > 
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> > 
> -- 
> Regards,
> 
> David Villasmilemail: david.villasmil.work at gmail.com
> phone: +34669448337
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200405/6ef5eec8/attachment-0001.html>


More information about the Users mailing list