[Asterisk-Users] billing realtime

Josh McAllister josh at singletouch.net
Wed Apr 26 12:25:57 MST 2006


You keep eluding to the answer yourself. Asterisk Manager is the way to
go. Check out
http://search.cpan.org/~xantus/POE-Component-Client-Asterisk-Manager/.
Relatively simple event based method for using Asterisk manager. What I
would do is register a handler to track new calls, and calls ending.
Every time you get a new call, add it to a hash with the customer_id as
the key. Seperately register a callback that keeps re-calling itself at
X second intervals. It would cycle through the hash of active calls
decrementing remaining time for each, and then kick anyone with < 1
second remaining.

I have a single script running 12 instances of
POE::Component::Client::Asterisk::Manager (1 for each of 12 servers)
under a single POE kernel to track > 2500 channels (comings and goings
of MeetMe users) and it's had no problem keeping up. Just make sure that
you avoid any long running loops as POE is not multi-threaded.

For something like this, I think you'll find 1 instance of a single
script much easier to track and debug than a whole bunch of instance of
an AGI script.

Josh McAllister


-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jon Farmer
Sent: Wednesday, April 26, 2006 7:27 AM
To: nick.hoffman at altcall.com
Cc: asterisk-users at lists.digium.com
Subject: Re: [Asterisk-Users] billing realtime



Nick Hoffman wrote:

> Hi Jon. If a customer has 10 minutes of call credit left and he makes
2 
> concurrent calls, how do you know to cut off the 2 calls at the 5
minute 
> mark rather than cut off both calls after 10 minutes?

That is the problem I am asking about :-)


-- 
Jon Farmer
Telford, Shropshire, UK
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users





More information about the asterisk-users mailing list