[asterisk-users] Limit monthly calls by context

adamk at 3a.hu adamk at 3a.hu
Wed Nov 16 08:02:43 CST 2011


Hello Hans,

On 11-16-2011 14:46, Hans Goossen wrote:

> I guess some "billing" solution can do the trick, but I think it's too much for that little. I don't need any other feature.
>

i would create a macro which calls an agi.  The agi searches the CDR 
table (mine is in sql) and calculates if the call can go through.  Then 
i'd call this macro from every extension in the dial plan just before 
the dial cmd.

> I was thinking something like checking the CDR before make the call, I know it may permit some "extra" minutes to be used, but it really doesn't need to be that exact. A couple of extra minutes won't hurt.
>

It depends on the number of simultaneous calls from within the same 
context.  The agi can return a number of seconds (calculated from sql) 
which the dial cmd can use as an absolute limit and after that amount of 
seconds it can hang up the call (see S or L flags).

regards
adam



More information about the asterisk-users mailing list