Two useful Asterisk Scripts
I have re-written my Asterisk CDR import script so that it now tests every record for uniqueness before inserting into the database. As long as the database has an index on the call date field the performance hit is very reasonable given the extra flexibility and ease of use this provides.
Previously if you started your SQL logging before you ran the import it wouldn’t work which was a major pain because generally you want to get the sever up and running with logging before worrying about old log records.
Now you can run the import anytime and it will import everything and won’t create duplicate records.
The new Asterisk cdr import V2 is located here.
I also finally got around to putting online my maxcallcount perl script. I run this script in a cron every night so I can keep track of how busy my asterisk server is getting. More importantly it tells me how many Zap channels we’re using so I know if we need to consider adding more PRIs.
It also catches things like people call-forward looping their phones which can eat up all the Zap channels in a big spike.
The maxcallcount script is located here.
They both can be found (with more Asterisk stuff) at this page : http://www.johnlange.ca/tech-tips/asterisk/