0
votes

I am new in asterisk. There is a solution named A2Billing for asterisk but i want to build something like below:

"Caller A is a registered sip peer in asterisk. A called to any number. After establish the call need to connect MySQL database to check A's talk time balance after each 10 second and deduct talk time for 10 second. When the talk time balance comes to 0 forcefully drop the call"

How can do this ? I am good in java. can java can handle this or what ? any suggestion welcome.

1

1 Answers

2
votes

You can use Java + AGI to connect MySQL or Mysql Function that can be used inside your extensions.conf, the DIAL app can drop the call after x ms time if you use the "L" flag !

L(x[:y][:z]): Limit the call to 'x' ms, warning when 'y' ms are left, repeated every 'z' ms) Only 'x' is required, 'y' and 'z' are optional. Numbers must be integers- beware of AGI scripts that may return long integers in scientific notation

Dial(SIP/${EXTEN}|60|L(300000))