i need help. I am using asterisk from source and using SIP. I am creating a web interface for users to view their outstanding credit. My webserver is seperate from the asterisk server. My problem is the creadit on the web interface does not show the real time amount right after the user hangs up. the user can only see the amount update when he tries to call again.
i have 3 AGI scripts thats being called when a user initiates a call.
first is “pre” pre calculates the amount of time a user can call base on his credit. (maxTimetoCall = credit / chargePerMinute)
second it goes to “recon” updates the credit base on the time consumed. (credit = credit - (CDR(billsec) / 60) * chargePerMinute)
-at this point the user ring the number. Dial(SIP/xxx)
when the user hangs up the third script executes.
third “post” posts the chargePerMinute of the call to the database.
(chargePerMinute = xxxxCountry-WhereTheUserIsPlacingACall)
it is obvious here that the first call did not reflect on the credit. However when the user calls again thats the time the “recon” updates the credit.
is there a better way todo this?