[asterisk-users] Caller ID questions

Ryan Wagoner rswagoner at gmail.com
Sat May 22 10:39:24 CDT 2010


On Sat, May 22, 2010 at 11:28 AM, Gordon Henderson
<gordon+asterisk at drogon.net> wrote:
> On Sat, 22 May 2010, GlenM wrote:
>
>> Hello Folks;
>>
>> I have a dilemma:
>>
>> I have a client with Asterisk 1.4x and he needs to have a record of all
>> incoming calls - caller ID and date/time is sufficient. Since I am not
>> an Asterisk wizard, I am doing it this way.
>>
>> I set a cron job to tailf the last 10 lines of the Master.csv file and
>> package those nicely in an email. However, I can see some inefficiencies
>> in this. Main one is what if there are more than 10 incoming calls
>> between cron runs?
>>
>> So, questions:
>>
>> 1. has anyone done this?
>> 2. is there a better way?
>> 3. if so, can you 'skool' me ?
>
> AIUI, Asterisk opens for append the Master.csv file, (fopen (... "a"))
> which creates the file if it doesn't existis.. writes a line to it then
> closes it for each CDR recorded, so ...
>
> You can rename the Master.csv file then email the file then delete it...
>
> Pseudocode:
>
> Once every 10 miuntes from cron:
>
>   if Master.csv does not exist, then exit      // No calls
>
>   rename Master.csv work.csv
>   sleep 1
>   process and email work.csv to whoever
>   delete work.csv
>   exit
>
> The sleep may not be needed, but it won't do any harm in the event that
> you rename the file after asterisk opens it but before it writes the line
> into and closed it.
>
> And instead of deleting the work.csv you could append it to some other
> file for a permanent log...
>
> Gordon
>
> --

I use asterisk-addons with mysql to store cdr data. I process this
data and insert it into the companies call database link to users, you
could just email it. I basically added a column to mysql and mark each
row as processed.

Ryan



More information about the asterisk-users mailing list