mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
61 lines
2.0 KiB
ReStructuredText
61 lines
2.0 KiB
ReStructuredText
OpenSIPS_ interaction via *event_datagram*
|
|
===========================================
|
|
|
|
Scenario
|
|
--------
|
|
|
|
- OpenSIPS out of *residential* configuration generated.
|
|
|
|
- Considering the following users (with configs hardcoded in the *opensips.cfg* configuration script): 1002-postpaid, 1003-pseudoprepaid, 1004-rated, 1007-rated.
|
|
- For simplicity we configure no authentication (WARNING: Not for production usage).
|
|
|
|
- **CGRateS** with following components:
|
|
|
|
- CGR-SM started as translator between OpenSIPS_ and **cgr-rater** for both authorization events (pseudoprepaid) as well as CDR ones.
|
|
- CGR-Mediator component attaching costs to the raw CDRs from OpenSIPS_ inside CGR StorDB.
|
|
- CGR-CDRE exporting mediated 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 OpenSIPS_ with custom configuration
|
|
----------------------------------------------
|
|
|
|
::
|
|
|
|
/usr/share/cgrates/tutorials/osips_event/opensips/etc/init.d/opensips start
|
|
|
|
To verify that OpenSIPS_ is running we run the console command:
|
|
|
|
::
|
|
|
|
opensipsctl moni
|
|
|
|
|
|
Starting **CGRateS** with custom configuration
|
|
----------------------------------------------
|
|
|
|
::
|
|
|
|
/usr/share/cgrates/tutorials/osips_event/cgrates/etc/init.d/cgrates start
|
|
|
|
Check that cgrates is running
|
|
|
|
::
|
|
|
|
cgr-console status
|
|
|
|
|
|
CDR processing
|
|
--------------
|
|
|
|
At the end of each call OpenSIPS_ will generate an CDR event and due to automatic handler registration built in **CGRateS-SM** component, this will be directed towards the port configured inside *cgrates.cfg*. This event will reach inside **CGRateS** through the *SM* component (close to real-time). Once in-there it will be instantly mediated and it is ready to be exported.
|
|
|
|
|
|
**CGRateS** Usage
|
|
-----------------
|
|
|
|
Since it is common to most of the tutorials, the example for **CGRateS** usage is provided in a separate page `here <http://cgrates.readthedocs.org/en/latest/tut_cgrates_usage.html>`_
|
|
|
|
|
|
.. _OpenSIPS: http://www.opensips.org/
|