mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
106 lines
3.4 KiB
ReStructuredText
106 lines
3.4 KiB
ReStructuredText
2. Architecture
|
|
===============
|
|
|
|
The CGRateS suite consits of three software applications, described bellow.
|
|
|
|
2.1. cgr-engine
|
|
--------------
|
|
The most important and complex as functionality.
|
|
|
|
Customisable through the use of a configuration file, it will start on demand one or more services, outlined bellow.
|
|
|
|
::
|
|
|
|
rif@grace:~$ cgr-engine -help
|
|
Usage of cgr-engine:
|
|
-config="/etc/cgrates/cgrates.cfg": Configuration file location.
|
|
-version=false: Prints the application version.
|
|
|
|
:Example: cgr-engine -config=cgr-customconfig.cfg
|
|
|
|
2.1.1. Rater service
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
Responsible with the following tasks:
|
|
|
|
- Operates on balances.
|
|
- Computes prices for rating subjects.
|
|
- Monitors and executes triggers.
|
|
|
|
Accessed by components using it's functionality via RPC or directly within same running cgr-engine process.
|
|
|
|
2.1.2. Balancer service
|
|
~~~~~~~~~~~~~~~~~~~~~~~
|
|
Optional component, used as proxy/balancer to a pool of Rater workers.
|
|
|
|
The Raters will register their availability to the Balancer thus implementing dynamic HA functionality.
|
|
|
|
2.1.3. Scheduler service
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
|
Used to execute periodic/scheduled tasks.
|
|
|
|
2.1.4. SessionManager service
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
Responsible with call control on the Telecommunication Switch side. Operates in two different modes (per call or globally):
|
|
|
|
- Prepaid
|
|
|
|
- Monitors call start.
|
|
- Checks balance availability for the call.
|
|
- Enforces global timer for a call at call-start.
|
|
- Executes routing commands for the call where that is necessary ( eg call un-park in case of FreeSWITCH).
|
|
- Periodically executes balance debits on call at the beginning of debit interval.
|
|
- Enforce call disconnection on insufficient balance.
|
|
- Refunds the balance taken in advance at the call stop.
|
|
|
|
- Postpaid
|
|
|
|
- Executes balance debit on call-stop.
|
|
|
|
All call actions are logged into CGRateS's LogDB.
|
|
|
|
2.1.5 Mediator service
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
Responsible to mediate the CDRs generated by Telecommunication Switch.
|
|
|
|
Has the ability to combine CDR fields into rating subject and run multiple mediation processes on the same record.
|
|
|
|
On Linux machines, able to work with inotify kernel subsystem in order to process the records close to real-time after the Switch has released them.
|
|
|
|
|
|
2.2. cgr-loader
|
|
---------------
|
|
Used for importing the rating information into the CGRateS database system.
|
|
|
|
::
|
|
|
|
rif@grace:~$ cgr-loader -help
|
|
Usage of cgr-loader:
|
|
-dbhost="localhost": The database host to connect to.
|
|
-dbname="10": he name/number of the database to connect to.
|
|
-dbpass="": The database user's password.
|
|
-dbport="6379": The database port to bind to.
|
|
-dbtype="redis": The type of the database (redis|mongo|postgres)
|
|
-dbuser="": The database user to sign in as.
|
|
-flush=false: Flush the database before importing
|
|
-path=".": The path containing the data files
|
|
-version=false: Prints the application version.
|
|
|
|
:Example: cgr-loader -flush
|
|
|
|
|
|
2.3. cgr-console
|
|
----------------
|
|
Command line tool used to interface with the Rater (or Balancer). Able to execute sub-commands
|
|
::
|
|
|
|
cgrrif@grace:~$ cgr-console -help
|
|
Usage of cgr-console:
|
|
-rpc_encoding="gob": RPC encoding used <gob|json>
|
|
-server="127.0.0.1:2012": server address host:port
|
|
-version=false: Prints the application version.
|
|
cgrrif@grace:~$ cgr-console help_more
|
|
2013/04/13 17:23:51
|
|
Usage: cgr-console [cfg_opts...{-h}] <status|get_balance>
|
|
|
|
:Example: cgr-console status
|