Hi Guys, we need an urgent help with Pre-paid Billing. We are using Asterisk at work with our own prepaid billing system. We calculate max number of minutes user is allowed to talk based on his balance and destination. We then used Dial command with S(x) parameter to create a call. However, this is a problem when user makes multiple calls simulatenously. What is the best way to handle it. Any suggestions. Please do not answer suggestion some billing packages as we have our own billing system which we need to enhance. Technical answer on howto do with bare asterisk or algorithm would help. Jim
You need some outside process to keep call state, probably using the Manager API and/or AGI. The outside process can listen to periodic call setup events at a relatively low polling interval and make appropriate adjustments to the user's credit in the database, which will then allow you to determine whether to allow another call to be set up given the available credit, etc. to a relatively high degree of accuracy. Jim Boykin wrote:> Hi Guys, we need an urgent help with Pre-paid Billing. > > We are using Asterisk at work with our own prepaid billing system. We > calculate max number of minutes user is allowed to talk based on his > balance and destination. We then used Dial command with S(x) parameter > to create a call. > > However, this is a problem when user makes multiple calls > simulatenously. What is the best way to handle it. Any suggestions. > > Please do not answer suggestion some billing packages as we have our > own billing system which we need to enhance. Technical answer on howto > do with bare asterisk or algorithm would help. > > Jim > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > AstriCon 2008 - September 22 - 25 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-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
Isn't 'don't allow multiple calls' acceptable solution? At least, it's the simplest one :) I can imagine solution with multiple calls allowed, but it needs some external synchronous processing. With every call you should start process, that will decrement user's balance based on dialled destination, you have to update balance every second. After balance=0 you just kill active call(s). The fact, that there are multiple calls means nothing, just more processes will decrement balance for the same user. Btw, this will give You oportunity upgrade balance during call, so active call can be longer than we originally thought - of course, you should not use S(x). There will be probably a lot of other / more effective, easier, ... / ideas :) Igor> Hi Guys, we need an urgent help with Pre-paid Billing.> We are using Asterisk at work with our own prepaid billing system. We > calculate max number of minutes user is allowed to talk based on his > balance and destination. We then used Dial command with S(x) parameter > to create a call.> However, this is a problem when user makes multiple calls > simulatenously. What is the best way to handle it. Any suggestions.> Please do not answer suggestion some billing packages as we have our > own billing system which we need to enhance. Technical answer on howto > do with bare asterisk or algorithm would help.> Jim> _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com --> AstriCon 2008 - September 22 - 25 Phoenix, Arizona > Register Now: http://www.astricon.net> asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users