[Asterisk-Dev] Feature request: CDR to serial port

Aaron S. Joyner asjoyner at intrex.net
Mon Sep 20 12:33:32 MST 2004


Chris A. Icide wrote:

> I'm interested in a module that would allow asterisk to output (based 
> upon a config file) certain CDR entries to a serial interface.

I'm sure having a native interface in * would have it's advantages, but 
don't discount the simple solution.  You can easily run a single command 
to tail the output of the cdr log, and send it to the serial port (`tail 
/var/log/asterisk/cdr-csv/Master.csv > /dev/ttyS0`).  As a super-simple 
solution for filtering, if you needs are this basic, you can exclude all 
extensions that match a regular expression so easy it's almost amusing 
(`tail /var/log/asterisk/cdr-csv/Master.csv | egrep -v 
'^.*?,.*?,"7...",' > /dev/ttyS0`).

If your filtering needs are more complex or if re-formatting of the 
native CVS format is required, a simple PERL script, or maybe even a  
bash shell script will suffice.  I would certainly suggest considering 
this option, before going so far as to extend Asterisk unnecessarily.  
The are very good reasons behind the UNIX design philosophy of small 
tools, operating on simple text streams, that are easily linked 
together.  This is just yet another example.

-- 
Aaron S. Joyner
System Administrator
Intrex.net Internet Services
(919) 573-5488




More information about the asterisk-dev mailing list