Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 28, 2024 3:36 pm
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 47 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: A2billing <-> Openser Project
PostPosted: Sat Jan 26, 2008 12:48 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
I'm just specking out a project to integrate A2B with Openser. I've managed to secure the services of an experienced Openser developer to work on the hooks.

I see this as an opportunity to get A2B into mainstream large setups. Clearly there is a need to replace alot of the A2B <-> asterisk stuff, but I don't see any real major issues. though time will tell.

Does anyone believe there is a wider need for this?

regards


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 26, 2008 2:00 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Absolutely yes, OpenSER would be a superb addition for the following reasons:-

1. Can be used to load balance across a number of Asterisk servers.

2. Has better NAT busting techniques than Asterisk for SIP.


A methodology could be to create a view in MySQL from the sip buddies table, and use that for clients to register and authenticate to openSER. This would tie A2Billing and openser together.

Here is an interesting article, which describes openSER with Asterisk realtime, which may give some pointers on how to proceed with this.

http://www.openser.org/dokuwiki/doku.ph ... ntegration

There is more information on this post: -

http://forum.asterisk2billing.org/viewtopic.php?t=2456

Yours

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 26, 2008 2:49 pm 
Offline

Joined: Sun Mar 12, 2006 2:49 pm
Posts: 954
Location: Barcelona
Hi,
What do u have in mind exactly ?
Changes on A2Billing to rate directly the CDR from SER!
The SER radius module can produce CDR very close of those we get on Asterisk.

Rgds, Areski


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 26, 2008 5:13 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
areski wrote:
Hi,
What do u have in mind exactly ?
Changes on A2Billing to rate directly the CDR from SER!
The SER radius module can produce CDR very close of those we get on Asterisk.

Rgds, Areski


That's pretty much the jist of it. Correct me if I'm wrong, but here's the flow.

Users already authenticated via the view of the sip buddies

Openser calls modified agi and a2b runs as normal, except outbound call leg is via Openser not asterisk.

Exactly how this is done, I'm not sure, but that's what I hope the developer will figure out.

I also envisage that inbound call routing be done via openser, (divert base on time, multiple destinations, call Q's etc) rather than in A2B. This would be a web page, linked from the existing customer UI

regards


Asterisk to act as Voicemail server.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 26, 2008 5:36 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
I believe that you can simply send SIP users registration to asterisk from openSER (after load balancing and failovering). Then when a call comes is, asterisk and a2billing will see it as a regular SIP buddy call. No need to modify the AGI. The flexibility of openSER will allow it to rewrite the SIP packet in order to stay in the path of the SIP dialog or not. The voice traffic will not go through openSER. That will be for the SIP user agent to handle (softphone, ATA, or DID provider).

Does that make sense? or do I need another cup or coffee?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 26, 2008 5:51 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
I'll need to think about that one.

However, back to basics.

Why use openser as a front end, my views are thus

Openser has much better NAT traversal
Can handle and account for redirects, which asterisk does not
Can handle more call setups/registrations

My views on A2B integration have modified somewhat after a few conversations, in that it might simply be a case of Openser handling the registration/redirects and then passing the call directely on to a2b/asterisk for call termination.

regards


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 26, 2008 6:14 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
There is also one important consideration. I have seen on this forum layout of an openSER setup which they claim was working. But it kinda lack scalability. And I thinking that openSER will not only allow what you have mentioned, but most importantly it will let you deploy a very large telephone system. If you manage to make openSER balance its own load, then the sky will be the limit.

Here is how I see it. OpenSER can do its round robin thing to balance the load between * servers.

For standard calling card usage, if you tie a DID access number to an * box, you can't get away from that box. So if the box gets really busy, that DID number will still send new calls to the busy box. Currently, the load of standard calling card call cannot be balanced in a2b unless I am mistaking.

One the other hand, if you handle that DID number through openSER, depending on the business of the 1st asterisk box, OpenSER can route the call to the next box.

Another advantage is that if the box becomes unavailable it will not bring the DID number down with it.

In that large scale vision, I am seeing asterisk boxes as plain asterisk boxes. The A2Billing UI and DB will be on it's own server. All you will need to maintain on the asterisk boxes will be the asterisk config (of course) and a few extensions and the agi script and a2billing.conf


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 26, 2008 7:05 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
I couln't agree more with your comments. Now that I have access to expert Openser knowledge I might be able to make progress on this.

Couple of thoughts spring to mind. How do we know a given asterisk server is overloading?

It makes sense to use a view of the mysql a2billing tables for Openser authentication. Unfortunately this means mysql 5.x. I'm running 4.x, so I need to see what impacts this may have on existing applications.

Sip to sip calls. There's no reason why these shouldn't even go anywhere near asterisk/a2b unless they're to be billed.

regards


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 26, 2008 7:16 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Very good question. I have been struggling with that question for almost a month. :lol:

What I have decided to do is to limit the maximum number of calls on the asterisk box to 2 channels, and to try to initiate a 3rd call and see what happens in the SIP reply message (All circuits busy, failed, ...) not sure. But if OpenSER gets that kind on message from asterisk, it will mean that asterisk could not handle the call and that asterisk did not accept the SIP INVITE. I will try it. But it will be cool if you can try it cause I have my hands full at the moment with some urgent stuff (my A2Billing 1.3.2 is not billing the 2nd leg of the callback when the 1st leg hangs up first)

You can set the maximum call limit in asterisk.conf

Code:
[options]

...

maxcalls = 10 ; Maximum amount of calls allowed
maxload = 0.9 ; Asterisk stops accepting new calls if the load average exceed this limit

...


Last edited by asiby on Wed Jan 30, 2008 12:16 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 28, 2008 3:35 pm 
Offline
Moderator
User avatar

Joined: Tue Jun 06, 2006 12:14 pm
Posts: 685
Location: florida
You know, another nice thing about SER, is that if you are using SIP-SIP friends as well as A2B calls, then you can intercept the SIP-SIP calls from SER, and process them with reinvites, and you never have to worry about bothering your Asterisk/A2B load with these calls.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 29, 2008 10:25 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
Been working on the subscriber issue.

Here's my plan so far.

I've added a few columns to the sip buddies table, namely the domain, ha1 and ha1b values

I''ve now created a trigger below. This will fire when a new row is added to the sip buddies table, calculating the hash values on the fly.

Quote:
create trigger `mya2billing`.`tr_insert_subscriber` BEFORE INSERT on `mya2billing`.`cc_sip_buddies`
for each row BEGIN
SET NEW.ser_ha1 = MD5(CONCAT(NEW.name,':',NEW.ser_domain,':',NEW.secret));
SET NEW.ser_ha1b = MD5(CONCAT(NEW.name,'@',NEW.ser_domain,':',NEW.ser_domain,':',NEW.secret));
END;


I will also write one for the update. This means that the ha1 and ha1b are always up to date with any changes to the passwords

My thinking is this. That the sip buddies holds esential information for SER, such that a view can then be created against it, that matches the format SER is expecting. This approach also doesn't inpact A2B users not using SER.

THoughts anyone? Also can anyone point me to the module in A2B that inserts/updates the buddies table?

regards


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 29, 2008 10:47 pm 
Offline
Moderator
User avatar

Joined: Tue Jun 06, 2006 12:14 pm
Posts: 685
Location: florida
I have a SER distribution setup that does the following:

User can sign up with any login name they want, does the validate that no duplicate name is in use, and then writes the record in the table and does the mail verification form such as we do in A2B.

User then dials any number they want. SER checks to see if there is a valid SIP friend with that name, and if so - sends them there with reinvite. If that user is busy/unavailable it sends them to voicemail.

If the number is not found as a SIP friend, it pushes the call to wherever you want (A2B for example). It does billing also but doesn't have B2BUA of course, and that's why I ended up going to A2B in the first place.

I have all the files required to do this although I haven't even looked at it in probably 2 years. The software I got from:

http://www.wifi.com.ar/english/voip/

There were some things that I definately liked on this, and I think to bridge it with A2B would be VERY nice. Take a look at it and tell me if anyone wants the source. I assume I'm allowed to since its open-source.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 29, 2008 11:07 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
Looks interesting, however, once the subscriber table is cracked, we are only weeks away from having full SER/A2B/Asterisk integration. My view is that when 1.4 is released, SER/OpenSER will be part of it, or rather an option. My concern is that we might be bombarded with SER issues with regards to setup. It's not exactly friendly

regards


Top
 Profile  
 
 Post subject: how about check below
PostPosted: Wed Jan 30, 2008 3:25 am 
Offline

Joined: Mon May 07, 2007 7:15 am
Posts: 19
Location: China
http://www.allvoipsolutions.org/mydrupal/node/212

it use a2billing DB,billing,all
openser db use a view from cc_sip_buddies


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 7:16 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
Thanks for this, a great help. I've tweaked the view so as not to have static domain.

In essence what I've done is delete the subscriber table from the openser db, installed the view below, and hey presto it works WITH NO CHANGES TO A2B! The domain is taken from the entry in the openser.domain table

Quote:
CREATE VIEW openser.subscriber
AS
select id,username,
openser.domain.domain as domain ,secret as password,'' as first_name,'' as last_name ,
' [email protected]' as email_address ,now() as datetime_created,
md5(concat(username,' : ',openser.domain.domain,' : ',secret)) as ha1,
md5(concat(username,'@',openser.domain.domain,' : ',openser.domain.domain,' : ',secret)) as ha1b ,'' as timezone,'' as rpid
from mya2billing.cc_sip_buddies, openser.domain


Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page 1, 2, 3, 4  Next
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group