You can do this with a global variable and a dedicated context.
From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Sammy Govind Sent: Wednesday, November 16, 2011 12:25 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Limit monthly calls by context I'd say try a2billing- thats abit of an overkill for just this functionality but you'll get lot or options to play with there. On Wed, Nov 16, 2011 at 7:02 PM, <ad...@3a.hu> wrote: 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 -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users