Hi,
some comments to your prepaid approach...
If you have the oportunity to avoid share the same balance between more than
two users, please do it.
It is better to assign one record to each user, and store in it, his/her
balance.
Don't complicate a simple solution.
Another comments:
1.- The determination of the max time to call it will involve the
DNIS(destination number) based of the rate matrix, the time when the call is
intended to be place (?cause you can establish different rate in function of
the hour, then you can offer special discount depending of the hour) and of
course the balance of the customer.
It is important to remember that in prepaid solutions exist two moments when
you need to calculate, first: max time to call, in this case is importan to
round the result, it is necessary to avoid negative balance in the Second:
moment, when you calculate the how much money you should discount to the
customer balance, it is function of the duration of the finished call.
2.- Why do you need to share the balance between multiple users? Why don't
assign different balance for each user?
If you have a way to identify every user (using a PIN) you could implement a
most simple and efficient prepaid solution.
If you don't want to use a PIN, try to identify the ANI(originator number)
to get access to the table of users when the balance is stored.
3. Today, exists some prepaid platform that implements the concept of Master
Account, where the balance is assigned to this account, and aditionally you
can create another sub-account relationed to one Master account, and you can
assign different balance for each sub-account without exceed the balance of
the Master, it means that the master balance is shared between the
sub-account. Every master account it would be assigned to one user, and the
existing sub-account it would be assigned to another user.
But it is necessary to identify every user at the moment when they try to
place a call.
4.- It is important to keep in mind that when you get access to the record
associated with a user, and you can get access to his/her balance, you need
to block the access to this record while you are accessing it. It is to
avoid the simultaneous access to the record that you are using to calculate
max time to call, and avoid to place a new call that generate at last,
negative balance (lost of money).
good luck &
best regards,
Rafance.
2008/10/20 Nhadie <nhadie at gmail.com>
> hi,
>
> for my multi-tenant pbx, i would like to approach prepaid like this:
>
> when a customer dials number, i have an AGI that will determine what
> country was dialed and retrieve the rate from the rate table,
>
> once the rate is retrieved, i will get the remaining balance of that
> customer nd compute how much time remaining based on the rte and the
> remaining balance. then i set that as an absolute timeout. after the
> call i update the balance depending on how much was used during the call.
>
> my prob is, there are multiple user behind one customer, so when 1 user
> calls i get the rate,get remaining balance, compute time remaining then
> while user 1 is engaged another user calls, since user 1 is not yet
> finish with the call the remaining balance is still the same for user 2
> even though user 1 has already used up some of the balance. is there
> anyway around this?
>
> regards,
> ron
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20081020/0e7e1ca2/attachment.htm