From e44dede8f9f3682173ca4956bcb2dac9fc71d0f4 Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 4 Aug 2015 00:37:57 +0200 Subject: [PATCH] Doc updates --- docs/cgrates_cfg.rst | 176 ---------------------------------------- docs/cgrates_json.rst | 10 +++ docs/configuration.rst | 6 +- docs/installation.rst | 16 +++- docs/tut_freeswitch.rst | 2 +- 5 files changed, 27 insertions(+), 183 deletions(-) delete mode 100644 docs/cgrates_cfg.rst create mode 100644 docs/cgrates_json.rst diff --git a/docs/cgrates_cfg.rst b/docs/cgrates_cfg.rst deleted file mode 100644 index 4a3343995..000000000 --- a/docs/cgrates_cfg.rst +++ /dev/null @@ -1,176 +0,0 @@ -cgr-engine configuration file -============================= - -Organized into configuration sections. All configuration options come with defaults and we have tried our best to choose the best ones for a minimum of efforts necessary when running. - -Bellow is the default configuration file which comes hardcoded into cgr-engine, most of them being explained and exemplified there. - -:: - - [global] - # ratingdb_type = redis # Rating subsystem database: . - # ratingdb_host = 127.0.0.1 # Rating subsystem database host address. - # ratingdb_port = 6379 # Rating subsystem port to reach the database. - # ratingdb_name = 10 # Rating subsystem database name to connect to. - # ratingdb_user = # Rating subsystem username to use when connecting to database. - # ratingdb_passwd = # Rating subsystem password to use when connecting to database. - # accountdb_type = redis # Accounting subsystem database: . - # accountdb_host = 127.0.0.1 # Accounting subsystem database host address. - # accountdb_port = 6379 # Accounting subsystem port to reach the database. - # accountdb_name = 11 # Accounting subsystem database name to connect to. - # accountdb_user = # Accounting subsystem username to use when connecting to database. - # accountdb_passwd = # Accounting subsystem password to use when connecting to database. - # stordb_type = mysql # Stor database type to use: - # stordb_host = 127.0.0.1 # The host to connect to. Values that start with / are for UNIX domain sockets. - # stordb_port = 3306 # The port to reach the logdb. - # stordb_name = cgrates # The name of the log database to connect to. - # stordb_user = cgrates # Username to use when connecting to stordb. - # stordb_passwd = CGRateS.org # Password to use when connecting to stordb. - # dbdata_encoding = msgpack # The encoding used to store object data in strings: - # rpc_json_listen = 127.0.0.1:2012 # RPC JSON listening address - # rpc_gob_listen = 127.0.0.1:2013 # RPC GOB listening address - # http_listen = 127.0.0.1:2080 # HTTP listening address - # default_reqtype = rated # Default request type to consider when missing from requests: <""|prepaid|postpaid|pseudoprepaid|rated>. - # default_category = call # Default Type of Record to consider when missing from requests. - # default_tenant = cgrates.org # Default Tenant to consider when missing from requests. - # default_subject = cgrates # Default rating Subject to consider when missing from requests. - # rounding_decimals = 10 # System level precision for floats - # http_skip_tls_veify = false # If enabled Http Client will accept any TLS certificate - # xmlcfg_path = # Path towards additional config defined in xml file - - [balancer] - # enabled = false # Start Balancer service: . - - [rater] - # enabled = false # Enable RaterCDRSExportPath service: . - # balancer = # Register to Balancer as worker: <""|internal|127.0.0.1:2013>. - - [scheduler] - # enabled = false # Starts Scheduler service: . - - [cdrs] - # enabled = false # Start the CDR Server service: . - # extra_fields = # Extra fields to store in CDRs for non-generic CDRs - # mediator = # Address where to reach the Mediator. Empty for disabling mediation. <""|internal> - # cdrstats = # Address where to reach the cdrstats service: - # store_disable = false # When true, CDRs will not longer be saved in stordb, useful for cdrstats only scenario - - [cdre] - # cdr_format = csv # Exported CDRs format - # data_usage_multiply_factor = 0.0 # Multiply data usage before export (eg: convert from KBytes to Bytes) - # cost_multiply_factor = 0.0 # Multiply cost before export (0.0 to disable), eg: add VAT - # cost_rounding_decimals = -1 # Rounding decimals for Cost values. -1 to disable rounding - # cost_shift_digits = 0 # Shift digits in the cost on export (eg: convert from EUR to cents) - # mask_destination_id = # Destination id containing called addresses to be masked on export - # mask_length = 0 # Length of the destination suffix to be masked - # export_dir = /var/log/cgrates/cdre # Path where the exported CDRs will be placed - # export_template = cgrid,mediation_runid,tor,accid,reqtype,direction,tenant,category,account,subject,destination,setup_time,answer_time,usage,cost - # Exported fields template <""|fld1,fld2|*xml:instance_name> - [cdrc] - # enabled = false # Enable CDR client functionality - # cdrs = internal # Address where to reach CDR server. - # run_delay = 0 # Sleep interval in seconds between consecutive runs, 0 to use automation via inotify - # cdr_type = csv # CDR file format . - # csv_separator = , # Separator used in case of csv files. One character only supported and needs to be right after equal sign - # cdr_in_dir = /var/log/cgrates/cdrc/in # Absolute path towards the directory where the CDRs are stored. - # cdr_out_dir = /var/log/cgrates/cdrc/out # Absolute path towards the directory where processed CDRs will be moved. - # cdr_source_id = csv # Free form field, tag identifying the source of the CDRs within CGRS database. - # tor_field = 2 # TypeOfRecord field identifier. Use index number in case of .csv cdrs. - # accid_field = 3 # Accounting id field identifier. Use index number in case of .csv cdrs. - # reqtype_field = 4 # Request type field identifier. Use index number in case of .csv cdrs. - # direction_field = 5 # Direction field identifier. Use index numbers in case of .csv cdrs. - # tenant_field = 6 # Tenant field identifier. Use index numbers in case of .csv cdrs. - # category_field = 7 # Type of Record field identifier. Use index numbers in case of .csv cdrs. - # account_field = 8 # Account field identifier. Use index numbers in case of .csv cdrs. - # subject_field = 9 # Subject field identifier. Use index numbers in case of .csv CDRs. - # destination_field = 10 # Destination field identifier. Use index numbers in case of .csv cdrs. - # setup_time_field = 11 # Setup time field identifier. Use index numbers in case of .csv cdrs. - # answer_time_field = 12 # Answer time field identifier. Use index numbers in case of .csv cdrs. - # usage_field = 13 # Usage field identifier. Use index numbers in case of .csv cdrs. - # extra_fields = # Extra fields identifiers. For .csv, format: :[...,:] - - [mediator] - # enabled = false # Starts Mediator service: . - # reconnects = 3 # Number of reconnects to rater/cdrs before giving up. - # rater = internal # Address where to reach the Rater: - # cdrstats = internal # Address where to reach the cdrstats service: - # store_disable = false # When true, CDRs will not longer be saved in stordb, useful for cdrstats only scenario - - - [cdrstats] - # enabled = false # Starts the cdrstats service: - # queue_length = 50 # Number of items in the stats buffer - # time_window = 1h # Will only keep the CDRs who's call setup time is not older than time.Now()-TimeWindow - # metrics = ASR, ACD, ACC # Stat metric ids to build - # setup_interval = # Filter on CDR SetupTime - # tors = # Filter on CDR TOR fields - # cdr_hosts= # Filter on CDR CdrHost fields - # cdr_sources = # Filter on CDR CdrSource fields - # req_types = # Filter on CDR ReqType fields - # directions = # Filter on CDR Direction fields - # tenants = # Filter on CDR Tenant fields - # categories = # Filter on CDR Category fields - # accounts = # Filter on CDR Account fields - # subjects = # Filter on CDR Subject fields - # destination_prefixes = # Filter on CDR Destination prefixes - # usage_interval = # Filter on CDR Usage - # mediation_run_ids = # Filter on CDR MediationRunId fields - # rated_accounts = # Filter on CDR RatedAccount fields - # rated_subjects = # Filter on CDR RatedSubject fields - # cost_intervals = # Filter on CDR Cost - - [session_manager] - # enabled = false # Starts SessionManager service: - # switch_type = freeswitch # Defines the type of switch behind: - # rater = internal # Address where to reach the Rater <""|internal|127.0.0.1:2013> - # cdrs = # Address where to reach CDR Server, empty to disable CDR capturing <""|internal|127.0.0.1:2013> - # reconnects = 3 # Number of reconnects to rater/cdrs before giving up. - # debit_interval = 10 # Interval to perform debits on. - # min_call_duration = 0s # Only authorize calls with allowed duration bigger than this - # max_call_duration = 3h # Maximum call duration a prepaid call can last - - [freeswitch] - # server = 127.0.0.1:8021 # Adress where to connect to FreeSWITCH socket. - # passwd = ClueCon # FreeSWITCH socket password. - # reconnects = 5 # Number of attempts on connect failure. - # min_dur_low_balance = 5s # Threshold which will trigger low balance warnings for prepaid calls (needs to be lower than debit_interval) - # low_balance_ann_file = # File to be played when low balance is reached for prepaid calls - # empty_balance_context = # If defined, prepaid calls will be transfered to this context on empty balance - # empty_balance_ann_file = # File to be played before disconnecting prepaid calls on empty balance (applies only if no context defined) - # cdr_extra_fields = # Extra fields to store in CDRs in case of processing them - - [opensips] - # listen_udp = 127.0.0.1:2020 # Address where to listen for datagram events coming from OpenSIPS - # mi_addr = 127.0.0.1:8020 # Adress where to reach OpenSIPS mi_datagram module - # events_subscribe_interval = 60s # Automatic events subscription to OpenSIPS, 0 to disable it - # reconnects = 3 # Number of attempts on connect failure. - - [derived_charging] - # run_ids = # Identifiers of additional sessions control. - # run_filters = # List of cdr field filters for each run. - # reqtype_fields = # Name of request type fields to be used during additional sessions control <""|*default|field_name>. - # direction_fields = # Name of direction fields to be used during additional sessions control <""|*default|field_name>. - # tenant_fields = # Name of tenant fields to be used during additional sessions control <""|*default|field_name>. - # category_fields = # Name of tor fields to be used during additional sessions control <""|*default|field_name>. - # account_fields = # Name of account fields to be used during additional sessions control <""|*default|field_name>. - # subject_fields = # Name of fields to be used during additional sessions control <""|*default|field_name>. - # destination_fields = # Name of destination fields to be used during additional sessions control <""|*default|field_name>. - # setup_time_fields = # Name of setup_time fields to be used during additional sessions control <""|*default|field_name>. - # answer_time_fields = # Name of answer_time fields to be used during additional sessions control <""|*default|field_name>. - # usage_fields = # Name of usage fields to be used during additional sessions control <""|*default|field_name>. - # combined_chargers = true # Combine accounts specific derived_chargers with server configured ones . - - [history_server] - # enabled = false # Starts History service: . - # history_dir = /var/log/cgrates/history # Location on disk where to store history files. - # save_interval = 1s # Interval to save changed cache into .git archive - - [history_agent] - # enabled = false # Starts History as a client: . - # server = internal # Address where to reach the master history server: - - [mailer] - # server = localhost # The server to use when sending emails out - # auth_user = cgrates # Authenticate to email server using this user - # auth_passwd = CGRateS.org # Authenticate to email server with this password - # from_address = cgr-mailer@localhost.localdomain # From address used when sending emails out diff --git a/docs/cgrates_json.rst b/docs/cgrates_json.rst new file mode 100644 index 000000000..7b48d6d29 --- /dev/null +++ b/docs/cgrates_json.rst @@ -0,0 +1,10 @@ +cgr-engine configuration file +============================= + +Organized into configuration sections. All configuration options come with defaults and we have tried our best to choose the best ones for a minimum of efforts necessary when running. + +Bellow is the default configuration file which comes hardcoded into cgr-engine, most of them being explained and exemplified there. + +:: + + :file: ../data/conf/cgrates/cgrates.json \ No newline at end of file diff --git a/docs/configuration.rst b/docs/configuration.rst index fa9159c3c..7012fc964 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -3,14 +3,14 @@ Configuration The behaviour of **CGRateS** can be externally influenced by following means: -- Engine configuration file, ussually located at */etc/cgrates/cgrates.cfg* -- Tariff Plans: set of files used to import customer rating and accounting data into CGRateS. +- Engine configuration files, usually located at */etc/cgrates/*. There can be one or multiple file/folder hierarchies behind configuration folder with support for automatic includes. The folders/files will be imported in alphabetical order into final configuration object. +- Tariff Plans: set of files used to import various data used in CGRateS subsystems (eg: Rating, Accounting, LCR, DerivedCharging, etc). - RPC APIs: set of JSON/GOB encoded APIs remotely available for various operational/administrative tasks. .. toctree:: :maxdepth: 2 - cgrates_cfg + cgrates_json tariff_plans diff --git a/docs/installation.rst b/docs/installation.rst index c3f8fdaef..9179ed1d0 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -7,8 +7,8 @@ We recommend using source installs for advanced users familiar with Go programmi 3.1. Using packages ------------------- -3.1.2. Debian Wheezy -~~~~~~~~~~~~~~~~~~~~ +3.1.2. Debian Jessie/Wheezy +~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is for the moment the only packaged and the most recommended to use method to install CGRateS. @@ -22,7 +22,7 @@ On the server you want to install CGRateS, simply execute the following commands apt-get install cgrates Once the installation is completed, one should perform the post-install section in order to have the CGRateS properly set and ready to run. -After post-install actions are performed, CGRateS will be configured in */etc/cgrates/cgrates.cfg* and enabled in */etc/default/cgrates*. +After post-install actions are performed, CGRateS will be configured in */etc/cgrates/cgrates.json* and enabled in */etc/default/cgrates*. 3.2. Using source ----------------- @@ -64,8 +64,18 @@ Once database is installed, CGRateS database needs to be set-up out of provided cd /usr/share/cgrates/storage/mysql/ ./setup_cgr_db.sh root CGRateS.org localhost +- PostgreSQL_ + +Once database is installed, CGRateS database needs to be set-up out of provided scripts (example for the paths set-up by debian package) + + :: + + cd /usr/share/cgrates/storage/postgres/ + ./setup_cgr_db.sh root CGRateS.org localhost + .. _Redis: http://redis.io/ .. _MySQL: http://www.mysql.org/ +.. _PostgreSQL: http://www.postgresql.org/ Git diff --git a/docs/tut_freeswitch.rst b/docs/tut_freeswitch.rst index 0ddd523cf..e03b9c859 100644 --- a/docs/tut_freeswitch.rst +++ b/docs/tut_freeswitch.rst @@ -1,4 +1,4 @@ -FreeSWITCH Integration Tutorials +sFreeSWITCH Integration Tutorials ================================ In these tutorials we exemplify few cases of integration between FreeSWITCH_ and **CGRateS**. We start with common steps, installation and postinstall processes then we dive into particular configurations, depending on the case we run.