I like it. I am thinking of putting this query in a C++ but I am a bit concern on 1) scalability 2) delays in setting up the calls shoud I be concerned? Uriel
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Tilghman Lesher Sent: Sunday, September 21, 2003 10:42 PM To: [EMAIL PROTECTED] Subject: Re: [Asterisk-Users] MY Sql CDR On Sunday 21 September 2003 18:16, Uriel Carrasquilla wrote: > I have a question regarding MySQL CDR's: > For a given extension I need to limit the number of minutes it can > use in a given week. > I was thinking about using the CDR information in the MySQL table to > see the usage for the week and then if exceeded, STOP the call and > play a message. does anybody have a suggestion on how to query the > database so I don't have to add-up all the minutes this particular > extension have used during the week? I'm guessing you're looking for a query formula? mysql> select sum(billsec) from cdr where calldate > '2003-09-01 00:00:00' and '2' in (src,dst); +--------------+ | sum(billsec) | +--------------+ | 173 | +--------------+ 1 row in set (0.03 sec) where '2' is the extension you want to limit. -Tilghman _______________________________________________ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users _______________________________________________ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users