Database on separate machine

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Database on separate machine

Gonzalo Gonzalez
I have opensips database in a separate machine and for the most part the connection work fine, but when I use credential opensips look at the localhost database not at the remote.

My config:

modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("usrloc", "db_mode", 2)
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("rr", "enable_full_lr", 1)
modparam("auth_db|permissions|uri_db|usrloc","db_url","mysql://opensips:opensipsrw@192.168.1.104/opensips")
modparam("permissions", "db_mode", 1)
modparam("permissions", "trusted_table", "trusted")
modparam("avpops", "avp_url", "mysql://opensips:opensipsrw@192.168.1.104/opensips")
modparam("avpops", "avp_table", "usr_preferences")
modparam("uri_db", "use_uri_table", 0)
modparam("uri_db", "db_url", "")

In the following statement only look at the database of the local machine:

 if (uri=~"^sip:[2-9][0-9]{9}@") {
        if (is_user_in("credentials","local")) {
            #prefix("+1");
            route(4);
            exit;
        } else {
            sl_send_reply("403", "No permissions for local calls");
            exit;
        };

Any Idea?

Thanks,

Gonzalo


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

Re: Database on separate machine

Bogdan-Andrei Iancu
Hi Gonzalo,

is_user_in() function is provided by the "group" module:
    http://www.opensips.org/html/docs/modules/1.4.x/group.html#id228379

so, you need to configure the DB url for this module also:
    http://www.opensips.org/html/docs/modules/1.4.x/group.html#id227194

Regards,
Bogdan

Gonzalo Gonzalez wrote:

> I have opensips database in a separate machine and for the most part
> the connection work fine, but when I use credential opensips look at
> the localhost database not at the remote.
>
> My config:
>
> modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
> modparam("usrloc", "db_mode", 2)
> modparam("auth_db", "calculate_ha1", yes)
> modparam("auth_db", "password_column", "password")
> modparam("rr", "enable_full_lr", 1)
> modparam("auth_db|permissions|uri_db|usrloc","db_url","mysql://opensips:opensipsrw@192.168.1.104/opensips")
> modparam("permissions", "db_mode", 1)
> modparam("permissions", "trusted_table", "trusted")
> modparam("avpops", "avp_url",
> "mysql://opensips:opensipsrw@192.168.1.104/opensips")
> modparam("avpops", "avp_table", "usr_preferences")
> modparam("uri_db", "use_uri_table", 0)
> modparam("uri_db", "db_url", "")
>
> In the following statement only look at the database of the local machine:
>
>  if (uri=~"^sip:[2-9][0-9]{9}@") {
>         if (is_user_in("credentials","local")) {
>             #prefix("+1");
>             route(4);
>             exit;
>         } else {
>             sl_send_reply("403", "No permissions for local calls");
>             exit;
>         };
>
> Any Idea?
>
> Thanks,
>
> Gonzalo
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Database on separate machine

Gonzalo Gonzalez
That fixed, Thank you very much.


Gonzalo

--- On Tue, 2/10/09, Bogdan-Andrei Iancu <[hidden email]> wrote:
From: Bogdan-Andrei Iancu <[hidden email]>
Subject: Re: [OpenSIPS-Users] Database on separate machine
To: [hidden email]
Cc: "Opensips" <[hidden email]>
Date: Tuesday, February 10, 2009, 6:40 PM

Hi Gonzalo,

is_user_in() function is provided by the "group" module:
http://www.opensips.org/html/docs/modules/1.4.x/group.html#id228379

so, you need to configure the DB url for this module also:
http://www.opensips.org/html/docs/modules/1.4.x/group.html#id227194

Regards,
Bogdan

Gonzalo Gonzalez wrote:
> I have opensips database in a separate machine and for the most part the
connection work fine, but when I use credential opensips look at the localhost
database not at the remote.
>
> My config:
>
> modparam("mi_fifo", "fifo_name",
"/tmp/opensips_fifo")
> modparam("usrloc", "db_mode", 2)
> modparam("auth_db", "calculate_ha1", yes)
> modparam("auth_db", "password_column",
"password")
> modparam("rr", "enable_full_lr", 1)
>
modparam("auth_db|permissions|uri_db|usrloc","db_url","mysql://opensips:opensipsrw@192.168.1.104/opensips")
> modparam("permissions", "db_mode", 1)
> modparam("permissions", "trusted_table",
"trusted")
> modparam("avpops", "avp_url",
"mysql://opensips:opensipsrw@192.168.1.104/opensips")
> modparam("avpops", "avp_table",
"usr_preferences")

> modparam("uri_db", "use_uri_table", 0)
> modparam("uri_db", "db_url", "")
>
> In the following statement only look at the database of the local machine:
>
> if (uri=~"^sip:[2-9][0-9]{9}@") {
> if (is_user_in("credentials","local")) {
> #prefix("+1");
> route(4);
> exit;
> } else {
> sl_send_reply("403", "No permissions for local
calls");

> exit;
> };
>
> Any Idea?
>
> Thanks,
>
> Gonzalo
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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