[OpenSIPS-Users] Separated registrar and proxy

Igor Pavlov igor.pavlov1987 at gmail.com
Mon Jul 31 00:32:26 EDT 2017


Hi, all.

I'm trying to separate registrar and proxy functions between several 
hosts. Registrations successfully  saves at registrar, but sip proxy 
could not find record when trying to lookup at "location" table on 
INVITE. I can't see any querys to my DB from proxy.

*registrar conf:*

loadmodule "usrloc.so"
modparam("usrloc", "db_url", 
"mysql://opensips:open_sips@db1.example.com/opensips")
modparam("usrloc", "db_mode", 2)

if (!save("location","f"))
     sl_reply_error(); //

*proxy conf:*

loadmodule "usrloc.so"
modparam("usrloc", "db_url", 
"mysql://opensips:open_sips@db1.example.com/opensips")
modparam("usrloc", "db_mode", 2)

route[location] {
     xlog("L_INFO","Lookup for $ru");
lookup("location");
     switch($retcode) {
         case -1:

         case -3:
              sl_send_reply("404","Not found");

              exit;

         case -2:

             sl_send_reply("405","Not found");

             exit;

      };

} //

-- 
____________
Best regards,
Igor Pavlov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170731/ef313d46/attachment.html>


More information about the Users mailing list