A2Billing Integration

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

A2Billing Integration

Gonzalo Gonzalez

I have been trying for weeks to integrate Oensips and A2Billing, but I just get more confused on how to do this. If I have Opensips and A2Billing on separate computers:

 

 

1-     I have to create a mysql view on the A2Billing server right?

2-     I have to point Opensips database to the A2Billing database right?

 

 

modparam("auth_db|permissions|uri_db|usrloc","db_url","mysql://a2billinguser:a2billing@192.168.1.104/mya2billing")

 192.168.1.104 is the A2Billing server.

 

This is the error I receive

 

Feb  9 12:19:47 sipproxy /usr/local/sbin/opensips[20140]: ERROR:db_mysql:db_mysql_submit_query: driver error on query: Table 'mya2billing.location' doesn't exist

Feb  9 12:19:47 sipproxy /usr/local/sbin/opensips[20140]: ERROR:core:db_do_query: error while submitting query

Feb  9 12:19:47 sipproxy /usr/local/sbin/opensips[20140]: ERROR:usrloc:testdb_udomain: failure in db_query

Feb  9 12:19:47 sipproxy /usr/local/sbin/opensips[20140]: ERROR:usrloc:register_udomain: testing domain 'location' failed

Feb  9 12:19:47 sipproxy /usr/local/sbin/opensips[20140]: ERROR:registrar:domain_fixup: failed to register domain

Feb  9 12:19:47 sipproxy /usr/local/sbin/opensips[20140]: ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 158

Feb  9 12:19:47 sipproxy /usr/local/sbin/opensips[20140]: ERROR:core:main: failed to fix configuration with err code -1

s

 

I know this is for somebody experienced, but always have to be an start point. Any hint will be appreciated.

 

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: A2Billing Integration

Raúl Alexis Betancor Santana
El Lunes, 9 de Febrero de 2009 18:41, Gonzalo Gonzalez escribió:
> May be I am not explaining myself right, but read this post:
>
> http://forum.asterisk2billing.org/viewtopic.php?t=2456
>
> I know people use the same database using database views.
>
> Thanks,
>
> Gonzalo

Please, reply to the list, not to me directly.

Talking about the issue .. that thread only said that you could use the same
DB throught views to have the same users on OpenSIPS and on Asterisk,
anything more.

You could not do accounting/billing only with OpenSIPS and A2Billing, that's
what I told you, you need OpenSIPS+Asterisk+A2Billing and IHMO that's a
horrible solution, with lot of problems on you future.

Regards
--
Raúl Alexis Betancor Santana
Dimensión Virtual

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

Re: A2Billing Integration

Gonzalo Gonzalez
It may not be the best solution, but it is something I can use. The idea is to have new customers sign in using A2Billing user interface, but register with opensips; that way if the customer dial long distance I can load balance with Asterisk/A2Billing and let the latest take care of the billing.

Thanks,

Gonzalo

--- On Mon, 2/9/09, Raúl Alexis Betancor Santana <[hidden email]> wrote:
From: Raúl Alexis Betancor Santana <[hidden email]>
Subject: Re: [OpenSIPS-Users] A2Billing Integration
To:
Cc: "[hidden email]" <[hidden email]>
Date: Monday, February 9, 2009, 8:22 PM

El Lunes, 9 de Febrero de 2009 18:41, Gonzalo Gonzalez escribió:
> May be I am not explaining myself right, but read this post:
>
> http://forum.asterisk2billing.org/viewtopic.php?t=2456
>
> I know people use the same database using database views.
>
> Thanks,
>
> Gonzalo

Please, reply to the list, not to me directly.

Talking about the issue .. that thread only said that you could use the same
DB throught views to have the same users on OpenSIPS and on Asterisk,
anything more.

You could not do accounting/billing only with OpenSIPS and A2Billing,
that's
what I told you, you need OpenSIPS+Asterisk+A2Billing and IHMO that's a
horrible solution, with lot of problems on you future.

Regards
--
Raúl Alexis Betancor Santana
Dimensión Virtual

_______________________________________________
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: A2Billing Integration

Juan Asencio
In reply to this post by Raúl Alexis Betancor Santana
Hi Raúl and list,

Could anyone explain a little bit, why the OpenSIPS+Asterisk+A2Billing
would be a horrible solution?

I'm new at this and I would like to learn and understand what kind of
problems could arise from such a solution.

Regards,

Juan.-

> El Lunes, 9 de Febrero de 2009 18:41, Gonzalo Gonzalez escribió:
>> May be I am not explaining myself right, but read this post:
>>
>> http://forum.asterisk2billing.org/viewtopic.php?t=2456
>>
>> I know people use the same database using database views.
>>
>> Thanks,
>>
>> Gonzalo
>
> Please, reply to the list, not to me directly.
>
> Talking about the issue .. that thread only said that you could use the
> same
> DB throught views to have the same users on OpenSIPS and on Asterisk,
> anything more.
>
> You could not do accounting/billing only with OpenSIPS and A2Billing,
> that's
> what I told you, you need OpenSIPS+Asterisk+A2Billing and IHMO that's a
> horrible solution, with lot of problems on you future.
>
> Regards
> --
> Raúl Alexis Betancor Santana
> Dimensión Virtual
>
> _______________________________________________
> 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: A2Billing Integration

Rafael Risco Gonzales-Vigil
Hi Juan
Its not a horrible solution, actually we are using both, Opensips and Asterisk (with a2billing AGI) in a heavy production environment for pre/post wholesale billing and I can control almost everything from a2billing admin interface.

Try this procedure:

You can use a mysql VIEW for 'opensips subscriber table' from 'a2billing user table' to facilitate opensips users provisioning from a2billing admin/user web interfaces.

For example, Sip proxy Opensips IP: 192.1689.12.254
DB: 192.168.1.29
A2billing DB: a2billing
A2billing subscriber table: cc_card

In mysql console:

USE opensips;

CREATE VIEW opensips.subscriber_v1 AS
SELECT id AS id,
useralias AS username,
'192.168.12.254' AS domain,
userpass AS password,
email AS email_address,
md5(concat(useralias,' : ','192.168.12.254',' : ',userpass)) AS ha1,
md5(concat(useralias,'@','192.168.12.254',' : ','192.168.12.254',' : ',userpass)) AS ha1b,
useralias AS rpid from a2billing.cc_card WHERE tariff=2;

INSERT INTO version (table_name,table_version) VALUES ('subscriber_v1','6');


Then in your opensips config file note that you have to indicate the new table 'subscriber_v1' as follows:

.
.
.
# Tablas 'uri' y tabla 'subscriber'
loadmodule "uri_db.so"
modparam("uri_db", "db_url", "mysql://opensips:******@192.168.1.29/opensips")
modparam("uri_db", "db_table", "subscriber_v1")
.
...
########################################################################
# Request route 'base-route-REGISTER'
########################################################################
route[2]
{
    sl_send_reply("100", "Trying");
    if(!www_authorize("", "subscriber_v1"))
    # Nota: tabla 'subscriber_v1' es un VIEW de mya2billing.cc_card
    {
        # xlog("L_INFO", "Register authentication failed - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci UA=$ua \n");
        xlog("L_INFO", "Register authentication failed - F=$fu IP=$si UA=$ua \n");
        www_challenge("", "0");
        exit;
    }
    if(!check_to()) ...
.
.
.
#########################################################################
# Request route 'base-route-INVITE'
#########################################################################
route[4]
{
    log(1," route[4]---> INVITE Message Handler \n");
    sl_send_reply("100", "Trying");
    if(from_gw())  ## verifica si la llamada viene de alguno de los GWs, tabla 'lcr'
    {
        xlog("L_INFO", "Call from PSTN - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
        setflag(23);
    }
    else
    {
        if(allow_trusted())  ## Si la llamada no viene del GW, verifica si el ip de origen esta en la tabla 'trusted'
        {
            xlog("L_INFO", "Call from trusted peer - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
            if(!is_domain_local("$rd"))
            {
                xlog("L_INFO", "Rejecting peering attempt with non-local request domain - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
                sl_send_reply("403", "Relaying Denied");
                exit;
            }
            setflag(23);
        }
        else ## => Si no viene del GW o de algun UA en 'trusted' entonces la llamada se origina en el sip server y debe autenticarse:
        {
            if(!proxy_authorize("", "subscriber_v1"))
            {
                xlog("L_INFO", "Proxy authentication failed - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci UA=$ua \n\n");
                proxy_challenge("", "0");
                exit;
            }
            if(!check_from())
.
.
.

Good luck!
Rafael

PS: I also want to know why some people think its a horrible solution... I think its the best.


On Tue, Feb 10, 2009 at 10:21 AM, Juan Asencio <[hidden email]> wrote:
Hi Raúl and list,

Could anyone explain a little bit, why the OpenSIPS+Asterisk+A2Billing
would be a horrible solution?

I'm new at this and I would like to learn and understand what kind of
problems could arise from such a solution.

Regards,

Juan.-

> El Lunes, 9 de Febrero de 2009 18:41, Gonzalo Gonzalez escribió:
>> May be I am not explaining myself right, but read this post:
>>
>> http://forum.asterisk2billing.org/viewtopic.php?t=2456
>>
>> I know people use the same database using database views.
>>
>> Thanks,
>>
>> Gonzalo
>
> Please, reply to the list, not to me directly.
>
> Talking about the issue .. that thread only said that you could use the
> same
> DB throught views to have the same users on OpenSIPS and on Asterisk,
> anything more.
>
> You could not do accounting/billing only with OpenSIPS and A2Billing,
> that's
> what I told you, you need OpenSIPS+Asterisk+A2Billing and IHMO that's a
> horrible solution, with lot of problems on you future.
>
> Regards
> --
> Raúl Alexis Betancor Santana
> Dimensión Virtual
>
> _______________________________________________
> 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


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

Re: A2Billing Integration

Juan Asencio
Rafael RGV wrote:

> Hi Juan
> Its not a horrible solution, actually we are using both, Opensips and
> Asterisk (with a2billing AGI) in a heavy production environment for
> pre/post wholesale billing and I can control almost everything from
> a2billing admin interface.
>
> Try this procedure:
>
> You can use a mysql VIEW for 'opensips subscriber table' from
> 'a2billing user table' to facilitate opensips users provisioning from
> a2billing admin/user web interfaces.
>
> For example, Sip proxy Opensips IP: 192.1689.12.254
> DB: 192.168.1.29
> A2billing DB: a2billing
> A2billing subscriber table: cc_card
>
> In mysql console:
>
> USE opensips;
>
> CREATE VIEW opensips.subscriber_v1 AS
> SELECT id AS id,
> useralias AS username,
> '192.168.12.254' AS domain,
> userpass AS password,
> email AS email_address,
> md5(concat(useralias,' : ','192.168.12.254',' : ',userpass)) AS ha1,
> md5(concat(useralias,'@','192.168.12.254',' : ','192.168.12.254',' :
> ',userpass)) AS ha1b,
> useralias AS rpid from a2billing.cc_card WHERE tariff=2;
>
> INSERT INTO version (table_name,table_version) VALUES
> ('subscriber_v1','6');
>
>
> Then in your opensips config file note that you have to indicate the
> new table 'subscriber_v1' as follows:
>
> .
> .
> .
> # Tablas 'uri' y tabla 'subscriber'
> loadmodule "uri_db.so"
> modparam("uri_db", "db_url",
> "mysql://opensips:******@192.168.1.29/opensips
> <http://192.168.1.29/opensips>")
> modparam("uri_db", "db_table", "subscriber_v1")
> .
> ...
> ########################################################################
> # Request route 'base-route-REGISTER'
> ########################################################################
> route[2]
> {
>     sl_send_reply("100", "Trying");
>     if(!www_authorize("", "subscriber_v1"))
>     # Nota: tabla 'subscriber_v1' es un VIEW de mya2billing.cc_card
>     {
>         # xlog("L_INFO", "Register authentication failed - M=$rm
> RURI=$ru F=$fu T=$tu IP=$si ID=$ci UA=$ua \n");
>         xlog("L_INFO", "Register authentication failed - F=$fu IP=$si
> UA=$ua \n");
>         www_challenge("", "0");
>         exit;
>     }
>     if(!check_to()) ...
> .
> .
> .
> #########################################################################
> # Request route 'base-route-INVITE'
> #########################################################################
> route[4]
> {
>     log(1," route[4]---> INVITE Message Handler \n");
>     sl_send_reply("100", "Trying");
>     if(from_gw())  ## verifica si la llamada viene de alguno de los
> GWs, tabla 'lcr'
>     {
>         xlog("L_INFO", "Call from PSTN - M=$rm RURI=$ru F=$fu T=$tu
> IP=$si ID=$ci\n");
>         setflag(23);
>     }
>     else
>     {
>         if(allow_trusted())  ## Si la llamada no viene del GW,
> verifica si el ip de origen esta en la tabla 'trusted'
>         {
>             xlog("L_INFO", "Call from trusted peer - M=$rm RURI=$ru
> F=$fu T=$tu IP=$si ID=$ci\n");
>             if(!is_domain_local("$rd"))
>             {
>                 xlog("L_INFO", "Rejecting peering attempt with
> non-local request domain - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
>                 sl_send_reply("403", "Relaying Denied");
>                 exit;
>             }
>             setflag(23);
>         }
>         else ## => Si no viene del GW o de algun UA en 'trusted'
> entonces la llamada se origina en el sip server y debe autenticarse:
>         {
>             if(!proxy_authorize("", "subscriber_v1"))
>             {
>                 xlog("L_INFO", "Proxy authentication failed - M=$rm
> RURI=$ru F=$fu T=$tu IP=$si ID=$ci UA=$ua \n\n");
>                 proxy_challenge("", "0");
>                 exit;
>             }
>             if(!check_from())
> .
> .
> .
>
> Good luck!
> Rafael
>
> PS: I also want to know why some people think its a horrible
> solution... I think its the best.
>
>
> On Tue, Feb 10, 2009 at 10:21 AM, Juan Asencio <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi Raúl and list,
>
>     Could anyone explain a little bit, why the OpenSIPS+Asterisk+A2Billing
>     would be a horrible solution?
>
>     I'm new at this and I would like to learn and understand what kind of
>     problems could arise from such a solution.
>
>     Regards,
>
>     Juan.-
>
>     > El Lunes, 9 de Febrero de 2009 18:41, Gonzalo Gonzalez escribió:
>     >> May be I am not explaining myself right, but read this post:
>     >>
>     >> http://forum.asterisk2billing.org/viewtopic.php?t=2456
>     >>
>     >> I know people use the same database using database views.
>     >>
>     >> Thanks,
>     >>
>     >> Gonzalo
>     >
>     > Please, reply to the list, not to me directly.
>     >
>     > Talking about the issue .. that thread only said that you could
>     use the
>     > same
>     > DB throught views to have the same users on OpenSIPS and on
>     Asterisk,
>     > anything more.
>     >
>     > You could not do accounting/billing only with OpenSIPS and
>     A2Billing,
>     > that's
>     > what I told you, you need OpenSIPS+Asterisk+A2Billing and IHMO
>     that's a
>     > horrible solution, with lot of problems on you future.
>     >
>     > Regards
>     > --
>     > Raúl Alexis Betancor Santana
>     > Dimensión Virtual
>     >
>     > _______________________________________________
>     > Users mailing list
>     > [hidden email] <mailto:[hidden email]>
>     > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>     >
>
>
>
>     _______________________________________________
>     Users mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
Rafael, thank you for the detail explanation.

If I get into trouble I will get back to you :)

Have a nice weekend,

Juan.-

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