[Asterisk-Users] MY Sql CDR

Uriel Carrasquilla uriel at adelphia.net
Sun Sep 21 21:30:10 MST 2003


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: asterisk-users-admin at lists.digium.com
[mailto:asterisk-users-admin at lists.digium.com]On Behalf Of Tilghman
Lesher
Sent: Sunday, September 21, 2003 10:42 PM
To: asterisk-users at lists.digium.com
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
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users





More information about the asterisk-users mailing list