From 18c3161b8dca255f0e45d3816eb143f3a5a2c189 Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 18 Aug 2015 13:06:05 +0200 Subject: [PATCH] Kamailio tutorial doc files --- docs/tut_kamailio.rst | 18 +++++++++++ docs/tut_kamailio_evapi.rst | 59 ++++++++++++++++++++++++++++++++++ docs/tut_kamailio_installs.rst | 20 ++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 docs/tut_kamailio.rst create mode 100644 docs/tut_kamailio_evapi.rst create mode 100644 docs/tut_kamailio_installs.rst diff --git a/docs/tut_kamailio.rst b/docs/tut_kamailio.rst new file mode 100644 index 000000000..035305881 --- /dev/null +++ b/docs/tut_kamailio.rst @@ -0,0 +1,18 @@ +Kamailio_ Integration Tutorials +=============================== + +In these tutorials we exemplify few cases of integration between Kamailio_ and CGRateS_. We start with common steps, installation and postinstall processes then we dive into particular configurations, depending on the case we run. + + +.. toctree:: + :maxdepth: 2 + + tut_kamailio_installs + tut_cgrates_installs + tut_jitsi_installs + tut_kamailio_evapi + tut_cgrates_usage + +.. _Kamailio: http://www.kamailio.org/ +.. _CGRateS: http://www.cgrates.org/ + diff --git a/docs/tut_kamailio_evapi.rst b/docs/tut_kamailio_evapi.rst new file mode 100644 index 000000000..04df505ff --- /dev/null +++ b/docs/tut_kamailio_evapi.rst @@ -0,0 +1,59 @@ +Kamailio_ interaction via *evapi* module +========================================= + +Scenario +-------- + + - Kamailio default configuration modified for **CGRateS** interaction. For script maintainability and simplicity we have separated CGRateS specific routes in *kamailio-cgrates.cfg* file which is included in main *kamailio.cfg* via include directive. + + - Considering the following users (with configs hardcoded in the *kamailio.cfg* configuration script and loaded in htable): 1001-prepaid, 1002-postpaid, 1003-pseudoprepaid, 1004-rated, 1005-rated, 1006-prepaid, 1007-prepaid. + +- **CGRateS** with following components: + + - CGR-SM started as translator between Kamailio_ and CGR-Rater for both authorization events as well as accounting ones. + - CGR-CDRS component processing raw CDRs from CGR-SM component and storing them inside CGR StorDB. + - CGR-CDRE exporting rated CDRs from CGR StorDB (export path: */tmp*). + - CGR-History component keeping the archive of the rates modifications (path browsable with git client at */tmp/cgr_history*). + + +Starting Kamailio_ with custom configuration +---------------------------------------------- + +:: + + /usr/share/cgrates/tutorials/kamevapi/kamailio/etc/init.d/kamailio start + +To verify that Kamailio_ is running we run the console command: + +:: + + kamctl moni + + +Starting **CGRateS** with custom configuration +---------------------------------------------- + +:: + + /usr/share/cgrates/tutorials/kamevapi/cgrates/etc/init.d/cgrates start + +Make sure that cgrates is running + +:: + + cgr-console status + + +CDR processing +-------------- + +At the end of each call Kamailio_ will generate an CDR event via *evapi* and this will be directed towards the port configured inside *cgrates.json*. This event will reach inside **CGRateS** through the *SM* component (close to real-time). Once in-there it will be instantly rated and be ready for export. + + +**CGRateS** Usage +----------------- + +Since it is common to most of the tutorials, the example for **CGRateS** usage is provided in a separate page `here `_ + + +.. _Kamailio: http://www.kamailio.org/ diff --git a/docs/tut_kamailio_installs.rst b/docs/tut_kamailio_installs.rst new file mode 100644 index 000000000..ff44d32e1 --- /dev/null +++ b/docs/tut_kamailio_installs.rst @@ -0,0 +1,20 @@ +Software installation +===================== + +As operating system we have choosen Debian Wheezy, since all the software components we use provide packaging for it. + +Kamailio_ +--------- + +We got Kamailio_ installed via following commands: +:: + + apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xfb40d3e6508ea4c8 + cd /etc/apt/sources.list.d/ + wget http://apt.itsyscom.com/conf/kamailio.apt.list . + apt-get update + apt-get install kamailio kamailio-extra-modules kamailio-json-modules + +Once installed we proceed with loading the configuration out of specific tutorial cases bellow. + +.. _Kamailio: http://www.kamailio.org/ \ No newline at end of file