asterisk-cdr-rss

This is a tool for producing RSS feeds from Asterisk call logs. It works for me, but it isn’t particularly complete.

It’s written in Ruby, a free scripting language that fits into the same general family as Perl and Python. Most Linux distributions include pre-compiled Ruby interpreters.

As configured, this tool assumes that your call detail records (CDR) are stored in a Postgres database called ‘asterisk’, and that it’ll allow a user called ‘asterisk’ to connect to the database without a password. It’s probably trivial to convert this script to using MySQL, but I haven’t tried.

As it currently stands, this tool produces two RSS feeds, ‘incoming’ and ‘outgoing’. At the moment, ‘incoming’ is defined as any call that:

Outgoing calls are simply defined as anything from the ‘Zap/2-1’ channel. This is obviously simplistic, but it works well enough for me right now.

Installation

Copy ‘cdrlib.rb’ to /usr/local/lib/site_ruby/1.8. Copy the two .cgi files into a directory that your web server can see.

You’ll probably want to edit the scripts unless your Asterisk setup is nearly identical to mine.

Security

As it currently stands, there is no security or privacy built into this tool. If don’t want the world to know who you’re calling, then be careful with your web server’s access control features. Personally, I keep these scripts inside of a password-protected part of my website.

To-do

Sooner or later, I’ll probably get around to adding a few more features: