In my experience dealing with it, it is precisely at the point where
multiple calls are involved that using a proxy for rating and mediation
purely becomes an impossible headache.
The conclusion I always came to in my implementations, which too always
started out with the noble goal of dealing with it all in proxy, is that
to properly handle this, I would need to extend the functionality to
include a B2BUA through which the calls are run that can sit there and
monitor them at a relatively low interval and record updates to their
duration into the database.
The B2BUA would need some sort of call control API, like Asterisk's
Manager API, or whatever Yate has, so that an outside process can sit
there and do statekeeping on the calls. You could do this without
handling media by using the B2BUA in a purely signaling capacity, which
I think is how Yate functions by default, and how Asterisk can function
with the "directrtpsetup" option in sip.conf.
It is then possible to know in reasonably real time the call duration
without waiting for an accounting stop event and thus make the
determination of whether another call should be allowed given the
balance depletion.
-- Alex
Adrian Georgescu wrote:
The problem with concurrent prepaid calls and single
balance is that
you have to correlate between the call control and rating angine
somehow so that all calls terminate when balnce becomes zero. The
problem is a bit complex:
Example:
Balance = 10.
A call starts to destination XXX, for the sake of example max session
time = 2 minutes
After one minute, you start second call to destination YYY which has a
different price and your balance is not anymore 10 but depends on the
duration of the first call which is in progress.
What is the maximum session time for it given that the first call is
already in progress?
What should happen with the first call?
I am looking for suggestions on implementing a proper algorithm to
deal with this situation in the rating engine. If you have any I would
be glad to hear it.
Adrian
_______________________________________________
Users mailing list
Users(a)lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
--
Alex Balashov
Evariste Systems
Web :
http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599