From 52376fadd0d13371c8d664c9081787ca5abe4601 Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 21 May 2013 13:27:55 +0200 Subject: [PATCH] Adding FreeSWITCH tutorial to documentation --- docs/installation.rst | 7 +-- docs/introduction.rst | 2 +- docs/tutfreeswitch.rst | 97 ++++++++++++++++++++++++++++++++++++++++++ docs/tutorials.rst | 5 +++ rater/calldesc.go | 2 +- 5 files changed, 108 insertions(+), 5 deletions(-) create mode 100644 docs/tutfreeswitch.rst diff --git a/docs/installation.rst b/docs/installation.rst index d7510d66d..fca70df2d 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -7,16 +7,17 @@ We recommend using source installs for advanced users familiar with Go programmi 3.1. Using packages ------------------- -3.1.2. Debian Squeeze -~~~~~~~~~~~~~~~~~~~ +3.1.2. Debian Wheezy (Squeeze is also backwards compatible) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + This is for the moment the only packaged and the most recommended to use method to install CGRateS. On the server you want to install CGRateS, simply execute the following commands: :: cd /etc/apt/sources.list.d/ - wget http://apt.itsyscom.com/repos/apt/conf/cgrates.apt.list wget -O - http://apt.itsyscom.com/repos/apt/conf/cgrates.gpg.key|apt-key add - + wget http://apt.itsyscom.com/repos/apt/conf/cgrates.apt.list apt-get update apt-get install cgrates diff --git a/docs/introduction.rst b/docs/introduction.rst index 4ced4046f..39c8abc35 100644 --- a/docs/introduction.rst +++ b/docs/introduction.rst @@ -30,7 +30,7 @@ Of course more SessionManagers can serve multiple Telecom Switches and all of th 1.1. CGRateS Features --------------------- -- Reliable and Fast ( very fast ;) ). To get an idea about speed, we have benchmarked 11000+ req/sec on a rather modest machine without requiring special tweaks in the kernel. +- Reliable and Fast ( very fast ;) ). To get an idea about speed, we have benchmarked 13000+ req/sec on a rather modest machine without requiring special tweaks in the kernel. - Using most modern programming concepts like multiprocessor support, asynchronous code execution within microthreads. - Built-in data caching system per call duration. - In-Memory database with persistence over restarts. diff --git a/docs/tutfreeswitch.rst b/docs/tutfreeswitch.rst new file mode 100644 index 000000000..e646f84f0 --- /dev/null +++ b/docs/tutfreeswitch.rst @@ -0,0 +1,97 @@ +7.1. FreeSWITCH Integration Tutorials +===================================== + +7.1.1. Automated prepaid with CSV CDRs +-------------------------------------- + +In this tutorial we are going to focus on simplicity of integrating CGRateS as carrier grade real-time charging engine for FreeSWITCH_. CGRateS will serve as both prepaid controller and rater for FreeSWITCH_ default generated CSV CDRs. A screencast version of this tutorial can be found on `YouTube `_. + + +7.1.1.1. Prerequisites +~~~~~~~~~~~~~~~~~~~~~~ + +OS: Debian Wheezy. Default options selected for installer. + +Install Redis_ to serve as DataDB for CGRateS. + +:: + + apt-get install redis-server + + +Install MongoDB_ to serve as LogDB for CGRateS. + +:: + + apt-get install mongodb + + +7.1.1.2. FreeSWITCH_ +~~~~~~~~~~~~~~~~~~~~ + +More information regarding installing FreeSWITCH_ on Debian can be found on it's official `installation wiki `_. + +To get FreeSWITCH_ installed and configured, we have choosen the simplest method, out of *vanilla* packages. +Bellow are the commands we have used to get FreeSWITCH_ up. + +:: + + gpg --keyserver pool.sks-keyservers.net --recv-key D76EDC7725E010CF + gpg -a --export D76EDC7725E010CF | sudo apt-key add - + cd /etc/apt/sources.list.d/ + wget http://apt.itsyscom.com/repos/apt/conf/freeswitch.apt.list + apt-get update + apt-get install freeswitch-meta-vanilla + cp -r /usr/share/freeswitch/conf/vanilla /etc/freeswitch + chown -R freeswitch:freeswitch /etc/freeswitch/ + /etc/init.d/freeswitch start + fs_cli + + +7.1.1.2. CGRateS +~~~~~~~~~~~~~~~~ + +Installation steps are provided on CGRateS `install documentation `_. + +To get CGRateS installed and configured, we have executed the following commands over console: + +:: + + cd /etc/apt/sources.list.d/ + wget -O - http://apt.itsyscom.com/repos/apt/conf/cgrates.gpg.key|apt-key add - + wget http://apt.itsyscom.com/repos/apt/conf/cgrates.apt.list + apt-get update + apt-get install cgrates + cd /usr/share/cgrates/data/rates/prepaid1centpsec/ + cgr-loader + cd /etc/cgrates/ + cp /usr/share/cgrates/data/conf/cgr_fs_prep_csv.cfg cgrates.cfg + svc -d /etc/service/cgrates/ + svc -u /etc/service/cgrates/ + tail -f /var/log/syslog + + +7.1.1.3. Final integration tests - Jitsi +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +On our ubuntu desktop host, we have installed Jitsi_ to be used as SIP UA, out of stable provided packages on `Jitsi download `_ and had Jitsi_ configured with 2 accounts out of default FreeSWITCH_ provided ones: 1001/1234 and 1002/1234. + +Calling between 1001 and 1002 should generate prepaid debits which are to be monitored in */var/log/syslog*. + +To check rating simply rotate the cdr files via fs_cli, checking the CDR prices in the location where CGRateS moves them, */var/log/cgrates/cdr_out*. + +:: + + fs_cli -x "cdr_csv rotate" + +.. _Redis: http://redis.io/ +.. _MongoDB: http://www.mongodb.org/ +.. _FreeSWITCH: http://www.freeswitch.org/ +.. _Jitsi: http://www.jitsi.org/ + + + + + + + diff --git a/docs/tutorials.rst b/docs/tutorials.rst index c62563c5c..b68a1c79a 100644 --- a/docs/tutorials.rst +++ b/docs/tutorials.rst @@ -1,2 +1,7 @@ 7. Tutorials ============ + +.. toctree:: + :maxdepth: 2 + + tutfreeswitch diff --git a/rater/calldesc.go b/rater/calldesc.go index 4f2e074a8..5a78e32a4 100644 --- a/rater/calldesc.go +++ b/rater/calldesc.go @@ -38,7 +38,7 @@ func init() { const ( RECURSION_MAX_DEPTH = 4 FALLBACK_SUBJECT = "*all" - VERSION = "1.0a5" + VERSION = "0.9.1rc2" ) var (