Adrian Georgescu napsal(a):
> 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.
>
I'm not sure if I can help, because I know nearly nothing about CDRTool,
but I had to solve problem with multiply calls on prepaid accounts in
the past. So let me describe it :-)
Requierements:
1. Prepaid accounts
2. Unlimited number of concurrent calls per user
3. OpenSER (without dialog module, becasuse it didn't exist yet)
Implementation:
1. We insert every call to the DB (MySQL, memory table) through the
OpenSER script when call starts and remove it when finished
2. We wrote daemon which reads all tariff plans and find smallest
tariffication time - 1 second in our case
3. This daemon every 1 second (see above) recount current price of all
active calls based on user tariff scheme (it is a little bit complex
task :-)
4. Than compare it with actual user acount balance
5. If balance <= current total, daemon kill all user calls (throught
OpenSER fifo send BYEs to both "phones")
Works fine :-)
Hope this helps.
Best regards,
kokoska.rokoska