[OpenSIPS-Users] Issues with registration proxy

Travis Manson-Drake travism at simplybits.com
Tue Dec 1 22:29:16 CET 2015


Hello Everyone!

Hope you're all doing well.

I seem to be having an issue.

Basically I'm using OpenSIPS as a proxy that will receive request from UAC's, then query a database to find out what Sipserver it belongs to then store the result with cachdb_local as an $avp variable, and finally modify the R-uri of the sip message to the UAC gets to the correct endpoint. I've got it working for the most part however I seem to be having an issue when I try to have multiple UAC's hit the proxy.

I think whats happening is the value stored in memchache is the first Sipserver the proxy gets a request for.

For example:

If UAC1 sends a REGISTER to the proxy and the proxy finds out it belongs on SIPServ1 it then sets the AVP to sipserv1

Now a few minutes later UAC2 comes along with a same REGISTER request but this time it belongs to SIPServ2, however this time it receives a 403 bad auth from sipserv2.

Here's my current logic for DB query and memcache store:

NOTE: This is also in the REQUEST Route section of my logic, so this takes place before it hits any other routing logic.

if(cache_fetch("local","PBX",$avp(PBX)))
                        {
                        $rd = $avp(PBX);
                        xlog("this is the value of the modified R-uri: $ru\n");
                        }
                else {
                        avp_db_query("select Servers.ipaddress from Servers where Servers.ID in (select phone.ServerID from phone where phone.mac in (select MAC FROM `phone_registrations` where auth_userid = '$fU'))", "$avp(PBX)");
                        cache_store("local","PBX","$avp(PBX)",1200);
                     }


Do you guys have any ideas on what I'm missing, or any advice?

Thank you in advanced!

Travis Manson-Drake
Voice Systems Analyst L1
Simply Bits, LLC
Now You're Thinkin' Smart!
5225 N. Sabino Canyon Road
Tucson, AZ 85750
Phone: 520-545-0311
Fax: 520-545-7252
Support Hotline: 5205450333
www.simplybits.com<http://www.simplybits.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20151201/b13d7d5b/attachment.htm>


More information about the Users mailing list