Separated registrar and proxy

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Separated registrar and proxy

Igor Pavlov-2

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", [hidden email])                                                                                                                 
modparam("usrloc", "db_mode", 2)                                                                                                                                                                 

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

proxy conf:

loadmodule "usrloc.so"                                                                                                                                                                           
modparam("usrloc", "db_url", [hidden email])                                                                                                                 
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

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Separated registrar and proxy

Bogdan-Andrei Iancu-2
Ho Igor,

Normally, in usrloc, the main data storage in the memory; the DB is used only for flushing the memory, for restart persistence. So, at runtime, OpenSIPS does not read from DB. The only db_mode where OpenSIPS read from DB is 3 (DB_ONLY) where the memory caching is disabled.

Regards,
Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  http://www.opensips-solutions.com

OpenSIPS Bootcamp 2017, Houston, US
  http://opensips.org/training/OpenSIPS_Bootcamp_2017.html
On 07/31/2017 07:32 AM, Igor Pavlov wrote:

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", [hidden email])                                                                                                                 
modparam("usrloc", "db_mode", 2)                                                                                                                                                                 

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

proxy conf:

loadmodule "usrloc.so"                                                                                                                                                                           
modparam("usrloc", "db_url", [hidden email])                                                                                                                 
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


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Loading...