<html dir="ltr"><head></head><body style="text-align:left; direction:ltr;"><div>Ok, to explain,</div><div><br></div><div>Using your logic,</div><div><br></div><div>To call say '555' will goto Voicemail, if I disable voicemail it will return a 404 instead of going to the load balancer.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>I cannot seem to create a catch all for non-usrloc registered extension calls to goto the load balancer otherwise return a 404.</div><div><br></div><div>I hope I explained it well enough. I will keep trying,</div><div><br></div><div>Regards,</div><div><br></div><div>Michael.</div><div><br></div><div>On Sun, 2020-04-05 at 11:47 +0100, David Villasmil wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div><div dir="auto">Why are you trying to do all at once?</div><div dir="auto"><br></div><div dir="auto">Why not first do the lookup </div><div dir="auto"><br></div><div dir="auto"><div><a href="https://github.com/davidcsi/kamailio-private-public/blob/a81d7f777a8c5ee2dbb32311f7e6b5a3cf94bf32/kamailio.cfg#L771">https://github.com/davidcsi/kamailio-private-public/blob/a81d7f777a8c5ee2dbb32311f7e6b5a3cf94bf32/kamailio.cfg#L771</a></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">and then start load balancing?</div><div dir="auto"><br></div><div dir="auto"><div><a href="https://github.com/davidcsi/kamailio-private-public/blob/a81d7f777a8c5ee2dbb32311f7e6b5a3cf94bf32/kamailio.cfg#L1109">https://github.com/davidcsi/kamailio-private-public/blob/a81d7f777a8c5ee2dbb32311f7e6b5a3cf94bf32/kamailio.cfg#L1109</a></div><br></div><div dir="auto"><br></div><div dir="auto">Do you have some special need to fulfill?</div><div dir="auto"><br></div><div dir="auto">David</div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 5 Apr 2020 at 06:34, Michael Vale via Users <<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>> wrote:<br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">hi,<br>
<br>
perhaps this can be solved with a failure route and or a check status<br>
but i dont know and it would be nice if i could do it without it.<br>
<br>
no matter how i write the script, either a uac to uac call goes to the<br>
load balancer or the load balancer is stuck with a 404 reply from the<br>
script or uac to uac works but when one end is not registered it goes<br>
to the load balancer instead of getting a 404.<br>
<br>
i've tried failure routes and get the same problem.  here is a snippet.<br>
<br>
       if (!lb_start(1,"pstn")) && (!lookup("location","m",)) {<br>
                lb_disable_dst();<br>
                #route(relay);<br>
                #send_reply(404,"No user or gateway");<br>
                        if (lb_start(1,"pstn")) {<br>
                                send_reply(500,"SIPSIPSIPS");<br>
                                #       t_relay();<br>
                                exit;<br>
                        }<br>
#               exit;<br>
                } else if (lookup("location","m")) &&<br>
(!lb_start(1,"pstn")) {<br>
                        lb_disable_dst();<br>
                        route(relay);<br>
                        exit;<br>
                } else if (lb_start(1,"pstn")) &&<br>
(lookup("location","m")) {<br>
                        lb_disable_dst();<br>
                        route(relay);<br>
                        exit;<br>
                } else if (!lookup("location","m")) &&<br>
(!lb_start(1,"pstn")) {<br>
                        send_reply(404,"Not Found");<br>
                        exit;<br>
                } else if (lb_start(1,"pstn")) &&<br>
(!lookup("location","m")) {<br>
#                       #lb_disable_dst();<br>
                        if (!lookup("location","m")) {<br>
                                route(relay);<br>
                                exit;<br>
                        }<br>
                        if (lookup("location","m")) {<br>
                                lb_disable_dst();<br>
                                route(relay);<br>
                                exit;<br>
                        }<br>
                }<br>
<br>
thanks in advance,<br>
<br>
michael.<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div>
</blockquote></body></html>