/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
*/
package config
const CGRATES_CFG_JSON = `
{
// Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
// Copyright (C) ITsysCOM GmbH
//
// This file contains the default configuration hardcoded into CGRateS.
// This is what you get when you load CGRateS with an empty configuration file.
"general": {
"node_id": "", // identifier of this instance in the cluster, if empty it will be autogenerated
"logger":"*syslog", // controls the destination of logs <*syslog|*stdout>
"log_level": 6, // control the level of messages logged (0-emerg to 7-debug)
"http_skip_tls_verify": false, // if enabled HttpClient will accept any TLS certificate
"rounding_decimals": 5, // system level precision for floats
"dbdata_encoding": "*msgpack", // encoding used to store object data in strings: <*msgpack|*json>
"tpexport_dir": "/var/spool/cgrates/tpe", // path towards export folder for offline TariffPlans
"poster_attempts": 3, // number of attempts before considering post request failed (eg: *call_url, CDR exports)
"failed_posts_dir": "/var/spool/cgrates/failed_posts", // directory path where we store failed requests
"default_request_type": "*rated", // default request type to consider when missing from requests: <""|*prepaid|*postpaid|*pseudoprepaid|*rated>
"default_category": "call", // default category to consider when missing from requests
"default_tenant": "cgrates.org", // default tenant to consider when missing from requests
"default_timezone": "Local", // default timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB>
"default_caching":"*reload", // default actions to do when caching items
"connect_attempts": 5, // initial server connect attempts
"reconnects": -1, // number of retries in case of connection lost
"connect_timeout": "1s", // consider connection unsuccessful on timeout, 0 to disable the feature
"reply_timeout": "2s", // consider connection down for replies taking longer than this value
"locking_timeout": "0", // timeout internal locks to avoid deadlocks
"digest_separator": ",", // separator to use in replies containing data digests
"digest_equal": ":", // equal symbol used in case of digests
"rsr_separator": ";", // separator used within RSR fields
},
"data_db": { // database used to store runtime data (eg: accounts)
"db_type": "*redis", // data_db type: <*redis|*mongo>
"db_host": "127.0.0.1", // data_db host address
"db_port": 6379, // data_db port to reach the database
"db_name": "10", // data_db database name to connect to
"db_user": "cgrates", // username to use when connecting to data_db
"db_password": "", // password to use when connecting to data_db
"redis_sentinel":"", // the name of sentinel when used
"query_timeout":"10s",
},
"stor_db": { // database used to store offline tariff plans and CDRs
"db_type": "*mysql", // stor database type to use: <*mongo|*mysql|*postgres|*internal>
"db_host": "127.0.0.1", // the host to connect to
"db_port": 3306, // the port to reach the stor_db
"db_name": "cgrates", // stor database name
"db_user": "cgrates", // username to use when connecting to stor_db
"db_password": "", // password to use when connecting to stor_db
"max_open_conns": 100, // maximum database connections opened, not applying for mongo
"max_idle_conns": 10, // maximum database connections idle, not applying for mongo
"conn_max_lifetime": 0, // maximum amount of time in seconds a connection may be reused (0 for unlimited), not applying for mongo
"cdrs_indexes": [], // indexes on cdrs table to speed up queries, used only in case of mongo
"query_timeout":"10s",
},
"listen": {
"rpc_json": "127.0.0.1:2012", // RPC JSON listening address
"rpc_gob": "127.0.0.1:2013", // RPC GOB listening address
"http": "127.0.0.1:2080", // HTTP listening address
"rpc_json_tls" : "127.0.0.1:2022", // RPC JSON TLS listening address
"rpc_gob_tls": "127.0.0.1:2023", // RPC GOB TLS listening address
"http_tls": "127.0.0.1:2280", // HTTP TLS listening address
},
"tls": {
"server_certificate" : "", // path to server certificate
"server_key":"", // path to server key
"client_certificate" : "", // path to client certificate
"client_key":"", // path to client key
"ca_certificate":"", // path to CA certificate (populate for self-signed certificate otherwise let it empty)
"server_policy":4, // server_policy determines the TLS Client Authentication (0-NoClientCert, 1-RequestClientCert, 2-RequireAnyClientCert, 3-VerifyClientCertIfGiven, 4-RequireAndVerifyClientCert)
"server_name":"",
},
"http": { // HTTP server configuration
"json_rpc_url": "/jsonrpc", // JSON RPC relative URL ("" to disable)
"ws_url": "/ws", // WebSockets relative URL ("" to disable)
"freeswitch_cdrs_url": "/freeswitch_json", // Freeswitch CDRS relative URL ("" to disable)
"http_cdrs": "/cdr_http", // CDRS relative URL ("" to disable)
"use_basic_auth": false, // use basic authentication
"auth_users": {}, // basic authentication usernames and base64-encoded passwords (eg: { "username1": "cGFzc3dvcmQ=", "username2": "cGFzc3dvcmQy "})
},
"scheduler": {
"enabled": false, // start Scheduler service:
"cdrs_conns": [], // connections to CDRs for *cdrlog actions <*internal|x.y.z.y:1234>
},
"cache":{
"destinations": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // destination caching
"reverse_destinations": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // reverse destinations index caching
"rating_plans": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // rating plans caching
"rating_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // rating profiles caching
"actions": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // actions caching
"action_plans": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // action plans caching
"account_action_plans": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // account action plans index caching
"action_triggers": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // action triggers caching
"shared_groups": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // shared groups caching
"timings": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // timings caching
"resource_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control resource profiles caching
"resources": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control resources caching
"event_resources": {"limit": -1, "ttl": "", "static_ttl": false}, // matching resources to events
"statqueue_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // statqueue profiles
"statqueues": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // statqueues with metrics
"threshold_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control threshold profiles caching
"thresholds": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control thresholds caching
"filters": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control filters caching
"supplier_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control supplier profile caching
"attribute_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control attribute profile caching
"charger_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control charger profile caching
"dispatcher_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control dispatcher profile caching
"dispatcher_hosts": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control dispatcher hosts caching
"resource_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false}, // control resource filter indexes caching
"stat_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false}, // control stat filter indexes caching
"threshold_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false}, // control threshold filter indexes caching
"supplier_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false}, // control supplier filter indexes caching
"attribute_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false}, // control attribute filter indexes caching
"charger_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false}, // control charger filter indexes caching
"dispatcher_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false}, // control dispatcher filter indexes caching
"dispatcher_routes": {"limit": -1, "ttl": "", "static_ttl": false}, // control dispatcher routes caching
"diameter_messages": {"limit": -1, "ttl": "3h", "static_ttl": false}, // diameter messages caching
"rpc_responses": {"limit": 0, "ttl": "2s", "static_ttl": false}, // RPC responses caching
"closed_sessions": {"limit": -1, "ttl": "10s", "static_ttl": false}, // closed sessions cached for CDRs
"load_ids": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control the load_ids for items
},
"filters": { // Filters configuration (*new)
"stats_conns": [], // connections to StatS for <*stats> filters, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
"resources_conns": [], // connections to ResourceS for <*resources> filters, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
},
"rals": {
"enabled": false, // enable Rating/Accounting service:
"thresholds_conns": [], // connections to ThresholdS for account/balance updates, empty to disable thresholds functionality: <""|*internal|x.y.z.y:1234>
"stats_conns": [], // connections to StatS for account/balance updates, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
"rp_subject_prefix_matching": false, // enables prefix matching for the rating profile subject
"remove_expired":true, // enables automatic removal of expired balances
"max_computed_usage": { // do not compute usage higher than this, prevents memory overload
"*any": "189h",
"*voice": "72h",
"*data": "107374182400",
"*sms": "10000"
},
},
"cdrs": { // CDRs config
"enabled": false, // start the CDR Server:
"extra_fields": [], // extra fields to store in CDRs for non-generic CDRs (ie: FreeSWITCH JSON)
"store_cdrs": true, // store cdrs in StorDB
"session_cost_retries": 5, // number of queries to session_costs before recalculating CDR
"chargers_conns": [ // connection to ChargerS for CDR forking, empty to disable billing for CDRs: <""|*internal|x.y.z.y:1234>
{"address": "*internal"}
],
"rals_conns": [ // connections to RALs for cost calculation: <""|*internal|x.y.z.y:1234>
{"address": "*internal"}
],
"attributes_conns": [], // connection to AttributeS for altering *raw CDRs, empty to disable attributes functionality: <""|*internal|x.y.z.y:1234>
"thresholds_conns": [], // connection to ThresholdS for CDR reporting, empty to disable thresholds functionality: <""|*internal|x.y.z.y:1234>
"stats_conns": [], // connections to StatS for CDR reporting, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
"online_cdr_exports":[], // list of CDRE profiles to use for real-time CDR exports
},
"cdre": { // CDRe config
"*default": {
"export_format": "*file_csv", // exported CDRs format <*file_csv|*file_fwv|*http_post|*http_json_cdr|*http_json_map|*amqp_json_cdr|*amqp_json_map|*sqs_json_map>
"export_path": "/var/spool/cgrates/cdre", // path where the exported CDRs will be placed
"filters" :[], // filters for this export
"tenant": "", // tenant used in filterS.Pass
"synchronous": false, // block processing until export has a result
"attempts": 1, // export attempts
"field_separator": ",", // used field separator in some export formats, eg: *file_csv
"usage_multiply_factor": {
"*any": 1 // multiply usage based on ToR field or *any for all
},
"cost_multiply_factor": 1, // multiply cost before export, eg: add VAT
"header_fields": [], // template of the exported header fields
"content_fields": [ // template of the exported content fields
{"tag": "CGRID", "type": "*composed", "value": "~CGRID"},
{"tag":"RunID", "type": "*composed", "value": "~RunID"},
{"tag":"TOR", "type": "*composed", "value": "~ToR"},
{"tag":"OriginID", "type": "*composed", "value": "~OriginID"},
{"tag":"RequestType", "type": "*composed", "value": "~RequestType"},
{"tag":"Tenant", "type": "*composed", "value": "~Tenant"},
{"tag":"Category", "type": "*composed", "value": "~Category"},
{"tag":"Account", "type": "*composed", "value": "~Account"},
{"tag":"Subject", "type": "*composed", "value": "~Subject"},
{"tag":"Destination", "type": "*composed", "value": "~Destination"},
{"tag":"SetupTime", "type": "*composed", "value": "~SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag":"AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag":"Usage", "type": "*composed", "value": "~Usage"},
{"tag":"Cost", "type": "*composed", "value": "~Cost", "rounding_decimals": 4},
],
"trailer_fields": [], // template of the exported trailer fields
},
},
"cdrc": [ // CDRc config
{
"id": "*default", // identifier of the CDRC runner
"enabled": false, // enable CDR client functionality
"dry_run": false, // do not send the CDRs to CDRS, just parse them
"cdrs_conns": [ // connections to CDRs. <*internal|x.y.z.y:1234>
{"address": "*internal"}
],
"cdr_format": "*csv", // CDR file format <*csv|*freeswitch_csv|*fwv|*opensips_flatstore|*partial_csv>
"field_separator": ",", // separator used in case of csv files
"timezone": "", // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB>
"run_delay": 0, // sleep interval in seconds between consecutive runs, 0 to use automation via inotify
"max_open_files": 1024, // maximum simultaneous files to process, 0 for unlimited
"data_usage_multiply_factor": 1024, // conversion factor for data usage
"cdr_in_dir": "/var/spool/cgrates/cdrc/in", // absolute path towards the directory where the CDRs are stored
"cdr_out_dir": "/var/spool/cgrates/cdrc/out", // absolute path towards the directory where processed CDRs will be moved
"failed_calls_prefix": "missed_calls", // used in case of flatstore CDRs to avoid searching for BYE records
"cdr_path": "", // path towards one CDR element in case of XML CDRs
"cdr_source_id": "freeswitch_csv", // free form field, tag identifying the source of the CDRs within CDRS database
"filters" :[], // limit parsing based on the filters
"tenant": "", // tenant used by import
"continue_on_success": false, // continue to the next template if executed
"partial_record_cache": "10s", // duration to cache partial records when not pairing
"partial_cache_expiry_action": "*dump_to_file", // action taken when cache when records in cache are timed-out <*dump_to_file|*post_cdr>
"header_fields": [], // template of the import header fields
"content_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
{"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "~2", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~3", "mandatory": true},
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~4", "mandatory": true},
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~6", "mandatory": true},
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "~7", "mandatory": true},
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~8", "mandatory": true},
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "~9", "mandatory": true},
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "~10", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "~11", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "~12", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*composed", "value": "~13", "mandatory": true},
],
"trailer_fields": [], // template of the import trailer fields
"cache_dump_fields": [ // template used when dumping cached CDR, eg: partial CDRs
{"tag": "CGRID", "type": "*composed", "value": "~CGRID"},
{"tag": "RunID", "type": "*composed", "value": "~RunID"},
{"tag": "TOR", "type": "*composed", "value": "~ToR"},
{"tag": "OriginID", "type": "*composed", "value": "~OriginID"},
{"tag": "RequestType", "type": "*composed", "value": "~RequestType"},
{"tag": "Tenant", "type": "*composed", "value": "~Tenant"},
{"tag": "Category", "type": "*composed", "value": "~Category"},
{"tag": "Account", "type": "*composed", "value": "~Account"},
{"tag": "Subject", "type": "*composed", "value": "~Subject"},
{"tag": "Destination", "type": "*composed", "value": "~Destination"},
{"tag": "SetupTime", "type": "*composed", "value": "~SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "Usage", "type": "*composed", "value": "~Usage"},
{"tag": "Cost", "type": "*composed", "value": "~Cost"},
],
},
],
"sessions": {
"enabled": false, // starts the session service:
"listen_bijson": "127.0.0.1:2014", // address where to listen for bidirectional JSON-RPC requests
"chargers_conns": [ // connections to ChargerS for session forking <*internal|x.y.z.y:1234>
{"address": "*internal"}
],
"rals_conns": [ // connections to RALs for rating/accounting <""|*internal|127.0.0.1:2013>
{"address": "*internal"}
],
"cdrs_conns": [ // connections to CDRs for CDR posting <*internal|x.y.z.y:1234>
{"address": "*internal"}
],
"resources_conns": [], // connections to ResourceS for resources monitoring <""|*internal|127.0.0.1:2013>
"thresholds_conns": [], // connections to ThresholdS for reporting session events <""|*internal|127.0.0.1:2013>
"stats_conns": [], // connections to StatS for reporting session events <""|*internal|127.0.0.1:2013>
"suppliers_conns": [], // connections to SupplierS for querying suppliers for event <""|*internal|127.0.0.1:2013>
"attributes_conns": [], // connections to AttributeS for altering event fields <""|*internal|127.0.0.1:2013>
"session_replication_conns": [], // replicate sessions towards these session services
"debit_interval": "0s", // interval to perform debits on.
"store_session_costs": false, // enable storing of the session costs within CDRs
"min_call_duration": "0s", // only authorize calls with allowed duration higher than this
"max_call_duration": "3h", // maximum call duration a prepaid call can last
"session_ttl": "0s", // time after a session with no updates is terminated, not defined by default
//"session_ttl_max_delay": "", // activates session_ttl randomization and limits the maximum possible delay
//"session_ttl_last_used": "", // tweak LastUsed for sessions timing-out, not defined by default
//"session_ttl_usage": "", // tweak Usage for sessions timing-out, not defined by default
"session_indexes": [], // index sessions based on these fields for GetActiveSessions API
"client_protocol": 1.0, // version of protocol to use when acting as JSON-PRC client <"0","1.0">
"channel_sync_interval": "0", // sync channels to detect stale sessions (0 to disable)
},
"asterisk_agent": {
"enabled": false, // starts the Asterisk agent:
"sessions_conns": [ // connections to SessionS for session management and CDR posting: <*internal>
{"address": "*internal"}
],
"create_cdr": false, // create CDR out of events and sends it to CDRS component
"asterisk_conns":[ // instantiate connections to multiple Asterisk servers
{"address": "127.0.0.1:8088", "user": "cgrates", "password": "CGRateS.org", "connect_attempts": 3,"reconnects": 5}
],
},
"freeswitch_agent": {
"enabled": false, // starts the FreeSWITCH agent:
"sessions_conns": [ // connections to SessionS for session management and CDR posting: <*internal>
{"address": "*internal"}
],
"subscribe_park": true, // subscribe via fsock to receive park events
"create_cdr": false, // creates CDR out of events and sends them to CDRS component
"extra_fields": [], // extra fields to store in auth/CDRs when creating them
//"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 transferred 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)
"max_wait_connection": "2s", // maximum duration to wait for a connection to be retrieved from the pool
"event_socket_conns":[ // instantiate connections to multiple FreeSWITCH servers
{"address": "127.0.0.1:8021", "password": "ClueCon", "reconnects": 5,"alias":""}
],
},
"kamailio_agent": {
"enabled": false, // starts Kamailio agent:
"sessions_conns": [ // connections to SessionS for session management and CDR posting: <*internal>
{"address": "*internal"}
],
"create_cdr": false, // create CDR out of events and sends them to CDRS component
"timezone": "", // timezone of the Kamailio server
"evapi_conns":[ // instantiate connections to multiple Kamailio servers
{"address": "127.0.0.1:8448", "reconnects": 5}
],
},
"diameter_agent": {
"enabled": false, // enables the diameter agent:
"listen": "127.0.0.1:3868", // address where to listen for diameter requests
"listen_net": "tcp", // transport type for diameter
"dictionaries_path": "/usr/share/cgrates/diameter/dict/", // path towards directory holding additional dictionaries to load
"sessions_conns": [ // connections to SessionS for session management and CDR posting
{"address": "*internal"}
],
"origin_host": "CGR-DA", // diameter Origin-Host AVP used in replies
"origin_realm": "cgrates.org", // diameter Origin-Realm AVP used in replies
"vendor_id": 0, // diameter Vendor-Id AVP used in replies
"product_name": "CGRateS", // diameter Product-Name AVP used in replies
"max_active_requests": -1, // limit the number of active requests processed by the server <-1|0-n>
"synced_conn_requests": false, // process one request at the time per connection
"asr_template": "", // enable AbortSession message being sent to client on DisconnectSession
"templates":{ // default message templates
"*err": [
{"tag": "SessionId", "field_id": "Session-Id", "type": "*composed",
"value": "~*req.Session-Id", "mandatory": true},
{"tag": "OriginHost", "field_id": "Origin-Host", "type": "*composed",
"value": "~*vars.OriginHost", "mandatory": true},
{"tag": "OriginRealm", "field_id": "Origin-Realm", "type": "*composed",
"value": "~*vars.OriginRealm", "mandatory": true},
],
"*cca": [
{"tag": "SessionId", "field_id": "Session-Id", "type": "*composed",
"value": "~*req.Session-Id", "mandatory": true},
{"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant",
"value": "2001"},
{"tag": "OriginHost", "field_id": "Origin-Host", "type": "*composed",
"value": "~*vars.OriginHost", "mandatory": true},
{"tag": "OriginRealm", "field_id": "Origin-Realm", "type": "*composed",
"value": "~*vars.OriginRealm", "mandatory": true},
{"tag": "AuthApplicationId", "field_id": "Auth-Application-Id", "type": "*composed",
"value": "~*vars.*appid", "mandatory": true},
{"tag": "CCRequestType", "field_id": "CC-Request-Type", "type": "*composed",
"value": "~*req.CC-Request-Type", "mandatory": true},
{"tag": "CCRequestNumber", "field_id": "CC-Request-Number", "type": "*composed",
"value": "~*req.CC-Request-Number", "mandatory": true},
],
"*asr": [
{"tag": "SessionId", "field_id": "Session-Id", "type": "*variable",
"value": "~*req.Session-Id", "mandatory": true},
{"tag": "OriginHost", "field_id": "Origin-Host", "type": "*variable",
"value": "~*req.Destination-Host", "mandatory": true},
{"tag": "OriginRealm", "field_id": "Origin-Realm", "type": "*variable",
"value": "~*req.Destination-Realm", "mandatory": true},
{"tag": "DestinationRealm", "field_id": "Destination-Realm", "type": "*variable",
"value": "~*req.Origin-Realm", "mandatory": true},
{"tag": "DestinationHost", "field_id": "Destination-Host", "type": "*variable",
"value": "~*req.Origin-Host", "mandatory": true},
{"tag": "AuthApplicationId", "field_id": "Auth-Application-Id", "type": "*variable",
"value": "~*vars.*appid", "mandatory": true},
{"tag": "UserName", "field_id": "User-Name", "type": "*variable",
"value": "~*req.User-Name", "mandatory": true},
{"tag": "OriginStateID", "field_id": "Origin-State-Id", "type": "*constant",
"value": "1"},
]
},
"request_processors": [ // list of processors to be applied to diameter messages
],
},
"radius_agent": {
"enabled": false, // enables the radius agent:
"listen_net": "udp", // network to listen on
"listen_auth": "127.0.0.1:1812", // address where to listen for radius authentication requests
"listen_acct": "127.0.0.1:1813", // address where to listen for radius accounting requests
"client_secrets": { // hash containing secrets for clients connecting here <*default|$client_ip>
"*default": "CGRateS.org"
},
"client_dictionaries": { // per client path towards directory holding additional dictionaries to load (extra to RFC)
"*default": "/usr/share/cgrates/radius/dict/", // key represents the client IP or catch-all <*default|$client_ip>
},
"sessions_conns": [ // connections to SessionS for session management and CDR posting
{"address": "*internal"}
],
"request_processors": [ // request processors to be applied to Radius messages
],
},
"http_agent": [ // HTTP Agents, ie towards cnc.to MVNE platform
],
"dns_agent": {
"enabled": false, // enables the DNS agent:
"listen": "127.0.0.1:2053", // address where to listen for DNS requests
"listen_net": "udp", // network to listen on
"sessions_conns": [ // connections to SessionS for session management and CDR posting
{"address": "*internal"}
],
"timezone": "", // timezone of the events if not specified
"request_processors": [ // request processors to be applied to DNS messages
],
},
"attributes": { // AttributeS config
"enabled": false, // starts attribute service: .
"indexed_selects":true, // enable profile matching exclusively on indexes
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
"process_runs": 1, // number of run loops when processing event
},
"chargers": { // ChargerS config
"enabled": false, // starts charger service: .
"attributes_conns": [], // connections to AttributeS for event fields altering <""|127.0.0.1:2013>
"indexed_selects":true, // enable profile matching exclusively on indexes
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
},
"resources": { // ResourceS config
"enabled": false, // starts ResourceLimiter service: .
"store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur>
"thresholds_conns": [], // connections to ThresholdS for resource reporting, empty to disable thresholds functionality: <""|*internal|x.y.z.y:1234>
"indexed_selects":true, // enable profile matching exclusively on indexes
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
},
"stats": { // StatS config
"enabled": false, // starts Stat service: .
"store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur>
"store_uncompressed_limit": 0, // used to compress data
"thresholds_conns": [], // connections to ThresholdS for StatUpdates, empty to disable thresholds functionality: <""|*internal|x.y.z.y:1234>
"indexed_selects":true, // enable profile matching exclusively on indexes
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
},
"thresholds": { // ThresholdS
"enabled": false, // starts ThresholdS service: .
"store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur>
"indexed_selects":true, // enable profile matching exclusively on indexes
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
},
"suppliers": { // SupplierS config
"enabled": false, // starts SupplierS service: .
"indexed_selects":true, // enable profile matching exclusively on indexes
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
"attributes_conns": [], // connections to AttributeS for altering events before supplier queries: <""|*internal|127.0.0.1:2013>
"rals_conns": [ // connections to RALs for cost/accounting <*internal>
{"address": "*internal"},
],
"resources_conns": [], // connections to ResourceS for *res sorting, empty to disable functionality: <""|*internal|x.y.z.y:1234>
"stats_conns": [], // connections to StatS for *stats sorting, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
},
"loaders": [ // LoaderS config
{
"id": "*default", // identifier of the Loader
"enabled": false, // starts as service: .
"tenant": "", // tenant used in filterS.Pass
"dry_run": false, // do not send the CDRs to CDRS, just parse them
"run_delay": 0, // sleep interval in seconds between consecutive runs, 0 to use automation via inotify
"lock_filename": ".cgr.lck", // Filename containing concurrency lock in case of delayed processing
"caches_conns": [ // connections to CacheS for data reload, empty for no reloads <""|*internal|x.y.z.y:1234>
{"address": "*internal"},
],
"field_separator": ",", // separator used in case of csv files
"tp_in_dir": "/var/spool/cgrates/loader/in", // absolute path towards the directory where the TPs are stored
"tp_out_dir": "/var/spool/cgrates/loader/out", // absolute path towards the directory where processed TPs will be moved
"data":[ // data profiles to load
{
"type": "*attributes", // data source type
"file_name": "Attributes.csv", // file name in the tp_in_dir
"fields": [
{"tag": "TenantID", "field_id": "Tenant", "type": "*composed", "value": "~0", "mandatory": true},
{"tag": "ProfileID", "field_id": "ID", "type": "*composed", "value": "~1", "mandatory": true},
{"tag": "Contexts", "field_id": "Contexts", "type": "*composed", "value": "~2"},
{"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*composed", "value": "~3"},
{"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*composed", "value": "~4"},
{"tag": "AttributeFilterIDs", "field_id": "AttributeFilterIDs", "type": "*composed", "value": "~5"},
{"tag": "FieldName", "field_id": "FieldName", "type": "*composed", "value": "~6"},
{"tag": "Type", "field_id": "Type", "type": "*composed", "value": "~7"},
{"tag": "Value", "field_id": "Value", "type": "*composed", "value": "~8"},
{"tag": "Weight", "field_id": "Weight", "type": "*composed", "value": "~9"},
],
},
{
"type": "*filters", // data source type
"file_name": "Filters.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~0", "mandatory": true},
{"tag": "ID", "field_id": "ID", "type": "*composed", "value": "~1", "mandatory": true},
{"tag": "FilterType", "field_id": "FilterType", "type": "*composed", "value": "~2"},
{"tag": "FilterFieldName", "field_id": "FilterFieldName", "type": "*composed", "value": "~3"},
{"tag": "FilterFieldValues", "field_id": "FilterFieldValues", "type": "*composed", "value": "~4"},
{"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*composed", "value": "~5"},
],
},
{
"type": "*resources", // data source type
"file_name": "Resources.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~0", "mandatory": true},
{"tag": "ID", "field_id": "ID", "type": "*composed", "value": "~1", "mandatory": true},
{"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*composed", "value": "~2"},
{"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*composed", "value": "~3"},
{"tag": "TTL", "field_id": "UsageTTL", "type": "*composed", "value": "~4"},
{"tag": "Limit", "field_id": "Limit", "type": "*composed", "value": "~5"},
{"tag": "AllocationMessage", "field_id": "AllocationMessage", "type": "*composed", "value": "~6"},
{"tag": "Blocker", "field_id": "Blocker", "type": "*composed", "value": "~7"},
{"tag": "Stored", "field_id": "Stored", "type": "*composed", "value": "~8"},
{"tag": "Weight", "field_id": "Weight", "type": "*composed", "value": "~9"},
{"tag": "ThresholdIDs", "field_id": "ThresholdIDs", "type": "*composed", "value": "~10"},
],
},
{
"type": "*stats", // data source type
"file_name": "Stats.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~0", "mandatory": true},
{"tag": "ID", "field_id": "ID", "type": "*composed", "value": "~1", "mandatory": true},
{"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*composed", "value": "~2"},
{"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*composed", "value": "~3"},
{"tag": "QueueLength", "field_id": "QueueLength", "type": "*composed", "value": "~4"},
{"tag": "TTL", "field_id": "TTL", "type": "*composed", "value": "~5"},
{"tag": "Metrics", "field_id": "Metrics", "type": "*composed", "value": "~6"},
{"tag": "Blocker", "field_id": "Blocker", "type": "*composed", "value": "~7"},
{"tag": "Stored", "field_id": "Stored", "type": "*composed", "value": "~8"},
{"tag": "Weight", "field_id": "Weight", "type": "*composed", "value": "~9"},
{"tag": "MinItems", "field_id": "MinItems", "type": "*composed", "value": "~10"},
{"tag": "ThresholdIDs", "field_id": "ThresholdIDs", "type": "*composed", "value": "~11"},
],
},
{
"type": "*thresholds", // data source type
"file_name": "Thresholds.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~0", "mandatory": true},
{"tag": "ID", "field_id": "ID", "type": "*composed", "value": "~1", "mandatory": true},
{"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*composed", "value": "~2"},
{"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*composed", "value": "~3"},
{"tag": "MaxHits", "field_id": "MaxHits", "type": "*composed", "value": "~4"},
{"tag": "MinHits", "field_id": "MinHits", "type": "*composed", "value": "~5"},
{"tag": "MinSleep", "field_id": "MinSleep", "type": "*composed", "value": "~6"},
{"tag": "Blocker", "field_id": "Blocker", "type": "*composed", "value": "~7"},
{"tag": "Weight", "field_id": "Weight", "type": "*composed", "value": "~8"},
{"tag": "ActionIDs", "field_id": "ActionIDs", "type": "*composed", "value": "~9"},
{"tag": "Async", "field_id": "Async", "type": "*composed", "value": "~10"},
],
},
{
"type": "*suppliers", // data source type
"file_name": "Suppliers.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~0", "mandatory": true},
{"tag": "ID", "field_id": "ID", "type": "*composed", "value": "~1", "mandatory": true},
{"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*composed", "value": "~2"},
{"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*composed", "value": "~3"},
{"tag": "Sorting", "field_id": "Sorting", "type": "*composed", "value": "~4"},
{"tag": "SortingParamameters", "field_id": "SortingParamameters", "type": "*composed", "value": "~5"},
{"tag": "SupplierID", "field_id": "SupplierID", "type": "*composed", "value": "~6"},
{"tag": "SupplierFilterIDs", "field_id": "SupplierFilterIDs", "type": "*composed", "value": "~7"},
{"tag": "SupplierAccountIDs", "field_id": "SupplierAccountIDs", "type": "*composed", "value": "~8"},
{"tag": "SupplierRatingPlanIDs", "field_id": "SupplierRatingPlanIDs", "type": "*composed", "value": "~9"},
{"tag": "SupplierResourceIDs", "field_id": "SupplierResourceIDs", "type": "*composed", "value": "~10"},
{"tag": "SupplierStatIDs", "field_id": "SupplierStatIDs", "type": "*composed", "value": "~11"},
{"tag": "SupplierWeight", "field_id": "SupplierWeight", "type": "*composed", "value": "~12"},
{"tag": "SupplierBlocker", "field_id": "SupplierBlocker", "type": "*composed", "value": "~13"},
{"tag": "SupplierParameters", "field_id": "SupplierParameters", "type": "*composed", "value": "~14"},
{"tag": "Weight", "field_id": "Weight", "type": "*composed", "value": "~15"},
],
},
{
"type": "*chargers", // data source type
"file_name": "Chargers.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~0", "mandatory": true},
{"tag": "ID", "field_id": "ID", "type": "*composed", "value": "~1", "mandatory": true},
{"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*composed", "value": "~2"},
{"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*composed", "value": "~3"},
{"tag": "RunID", "field_id": "RunID", "type": "*composed", "value": "~4"},
{"tag": "AttributeIDs", "field_id": "AttributeIDs", "type": "*composed", "value": "~5"},
{"tag": "Weight", "field_id": "Weight", "type": "*composed", "value": "~6"},
],
},
{
"type": "*dispatchers", // data source type
"file_name": "DispatcherProfiles.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~0", "mandatory": true},
{"tag": "ID", "field_id": "ID", "type": "*composed", "value": "~1", "mandatory": true},
{"tag": "Contexts", "field_id": "Contexts", "type": "*composed", "value": "~2"},
{"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*composed", "value": "~3"},
{"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*composed", "value": "~4"},
{"tag": "Strategy", "field_id": "Strategy", "type": "*composed", "value": "~5"},
{"tag": "StrategyParameters", "field_id": "StrategyParameters", "type": "*composed", "value": "~6"},
{"tag": "ConnID", "field_id": "ConnID", "type": "*composed", "value": "~7"},
{"tag": "ConnFilterIDs", "field_id": "ConnFilterIDs", "type": "*composed", "value": "~8"},
{"tag": "ConnWeight", "field_id": "ConnWeight", "type": "*composed", "value": "~9"},
{"tag": "ConnBlocker", "field_id": "ConnBlocker", "type": "*composed", "value": "~10"},
{"tag": "ConnParameters", "field_id": "ConnParameters", "type": "*composed", "value": "~11"},
{"tag": "Weight", "field_id": "Weight", "type": "*composed", "value": "~12"},
],
},
{
"type": "*dispatcher_hosts", // data source type
"file_name": "DispatcherHosts.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~0", "mandatory": true},
{"tag": "ID", "field_id": "ID", "type": "*composed", "value": "~1", "mandatory": true},
{"tag": "Address", "field_id": "Address", "type": "*composed", "value": "~2"},
{"tag": "Transport", "field_id": "Transport", "type": "*composed", "value": "~3"},
{"tag": "TLS", "field_id": "TLS", "type": "*composed", "value": "~4"},
],
},
],
},
],
"mailer": {
"server": "localhost", // the server to use when sending emails out
"auth_user": "cgrates", // authenticate to email server using this user
"auth_password": "CGRateS.org", // authenticate to email server with this password
"from_address": "cgr-mailer@localhost.localdomain" // from address used when sending emails out
},
"suretax": {
"url": "", // API url
"client_number": "", // client number, provided by SureTax
"validation_key": "", // validation key provided by SureTax
"business_unit": "", // client’s Business Unit
"timezone": "Local", // convert the time of the events to this timezone before sending request out
"include_local_cost": false, // sum local calculated cost with tax one in final cost
"return_file_code": "0", // default or Quote purposes <0|Q>
"response_group": "03", // determines how taxes are grouped for the response <03|13>
"response_type": "D4", // determines the granularity of taxes and (optionally) the decimal precision for the tax calculations and amounts in the response
"regulatory_code": "03", // provider type
"client_tracking": "CGRID", // template extracting client information out of StoredCdr; <$RSRFields>
"customer_number": "Subject", // template extracting customer number out of StoredCdr; <$RSRFields>
"orig_number": "Subject", // template extracting origination number out of StoredCdr; <$RSRFields>
"term_number": "Destination", // template extracting termination number out of StoredCdr; <$RSRFields>
"bill_to_number": "", // template extracting billed to number out of StoredCdr; <$RSRFields>
"zipcode": "", // template extracting billing zip code out of StoredCdr; <$RSRFields>
"plus4": "", // template extracting billing zip code extension out of StoredCdr; <$RSRFields>
"p2pzipcode": "", // template extracting secondary zip code out of StoredCdr; <$RSRFields>
"p2pplus4": "", // template extracting secondary zip code extension out of StoredCdr; <$RSRFields>
"units": "^1", // template extracting number of “lines” or unique charges contained within the revenue out of StoredCdr; <$RSRFields>
"unit_type": "^00", // template extracting number of unique access lines out of StoredCdr; <$RSRFields>
"tax_included": "^0", // template extracting tax included in revenue out of StoredCdr; <$RSRFields>
"tax_situs_rule": "^04", // template extracting tax situs rule out of StoredCdr; <$RSRFields>
"trans_type_code": "^010101", // template extracting transaction type indicator out of StoredCdr; <$RSRFields>
"sales_type_code": "^R", // template extracting sales type code out of StoredCdr; <$RSRFields>
"tax_exemption_code_list": "", // template extracting tax exemption code list out of StoredCdr; <$RSRFields>
},
"loader": { // loader for tariff plans out of .csv files
"tpid": "", // tariff plan identificator
"data_path": "./", // path towards tariff plan files
"disable_reverse": false, // disable reverse computing
"field_separator": ",", // separator used in case of csv files
"caches_conns":[ // connections to CacheS for reloads
{"address": "127.0.0.1:2012", "transport": "*json"}
],
"scheduler_conns": [ // connections to SchedulerS for reloads
{"address": "127.0.0.1:2012", "transport": "*json"}
],
},
"migrator": {
"out_datadb_type": "redis",
"out_datadb_host": "127.0.0.1",
"out_datadb_port": "6379",
"out_datadb_name": "10",
"out_datadb_user": "cgrates",
"out_datadb_password": "",
"out_datadb_encoding" : "msgpack",
"out_stordb_type": "mysql",
"out_stordb_host": "127.0.0.1",
"out_stordb_port": "3306",
"out_stordb_name": "cgrates",
"out_stordb_user": "cgrates",
"out_stordb_password": "",
"users_filters":[],
},
"dispatchers":{ // DispatcherS config
"enabled": false, // starts DispatcherS service: .
"indexed_selects":true, // enable profile matching exclusively on indexes
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
"attributes_conns": [], // connections to AttributeS for API authorization, empty to disable auth functionality: <""|*internal|x.y.z.y:1234>
},
"analyzers":{ // AnalyzerS config
"enabled":false // starts AnalyzerS service: .
},
"apier": {
"caches_conns":[ // connections to CacheS for reloads
{"address": "*internal"},
],
"scheduler_conns": [ // connections to SchedulerS for reloads
{"address": "*internal"}
],
},
}`