Book Image

FreeSWITCH Cookbook

By : Raymond Chandler, Darren Schreiber, Anthony Minessale II, Michael Collins
Book Image

FreeSWITCH Cookbook

By: Raymond Chandler, Darren Schreiber, Anthony Minessale II, Michael Collins

Overview of this book

FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice, chat, and video applications. It can scale from a soft-phone to a PBX and even up to an enterprise-class softswitch.In the FreeSWITCH Cookbook, members of the FreeSWITCH development team share some of their hard-earned knowledge with you in the book's recipes. Use this knowledge to improve and expand your FreeSWITCH installations.The FreeSWITCH Cookbook is an essential addition to any VoIP administrator's library.The book starts with recipes on how to handle call routing and then discusses connecting your FreeSWITCH server to the outside world.It then teaches you more advanced topics like CDR handling, practical examples of controlling FreeSWITCH with the event socket, and configuring many features commonly associated with a PBX installation.
Table of Contents (12 chapters)
FreeSWITCH Cookbook
About the Authors
About the Reviewers

Inserting CDRs into a backend database

Frequently it is necessary to put CDR information into a database such as MySQL, PostgreSQL, or other SQL databases. FreeSWITCH does not support writing CDRs directly to a database (the decision not to write directly to a database is an engineering, not a technical limitation). This recipe discusses the simple method of writing SQL-based CSV files and then using those to update a backend database.

Getting ready

Of course, you will need a database in which to store your files. Any SQL-compliant database will work as long as you can use the command line to execute SQL statements. Create a database for your CDRs and allow any necessary access. This is completely dependent upon the type of database you have—consult your database documentation for specific instructions.

You will also need a table for the CDRs. The following CREATE TABLE syntax for a PostgreSQL database will work for the existing sql template in cdr_csv.conf.xml: