System.conf

From Kolmisoft Wiki
Revision as of 14:57, 1 April 2025 by Ricardass (talk | contribs)
Jump to navigationJump to search

This file is in /etc/m2/system.conf and describes some values for the M4 systems.

Database settings

  • dbname - MySQL database name.
  • dbuser - MySQL database user.
  • dbhost - MySQL database host.
  • dbsecret - MySQL database password.
  • dbport - MySQL database port.
  • db_startup_retry - number of database connection attempts on Radius startup. If after N attempts, connection to the database is not established, Radius will exit. Default 10 retries.
  • db_startup_retry_delay - how many seconds to wait before each database connection attempt. Default 10 seconds.

Basic settings

  • global_call_timeout - the maximum length of call (default 7200 seconds)
  • balance_check_period – how often to recalculate the total price for the user's concurrent calls. The calculated price is compared with the user's balance and if the total price is lower than the balance limit, all user's calls will be terminated. The default value is 0 (in seconds) - disabled.
  • active_calls_check_period – how often to update active calls. The default value is 5 (in seconds)
  • start_timeout - timeout between call initiation and answer/hangup. The default value is 240 seconds. If the call is not answered or hangup in this period of time, M4 will drop the call with 314 HGC.
  • stop_timeout - timeout between call answer and hang up. The default value is 7200 seconds. If the call is answered but the hangup is not received in this period of time, M4 will drop the call with 315 HGC.
  • server_id - current server id (should match Maintenance -> Servers)
  • billsec_round_function - how billsec should be rounded? Allowed values are ceil, round and floor. Ceil will round to a higher value (1.1 will be rounded to 2), round will round to the closest value (1.4 will be rounded to 1 and 1.5 will be rounded to 2), floor will round to the lower value (1.9 will be rounded to 1). By default, ceil is used to round billsec.
  • mysql_ping - Default 0 (disabled). If the value is greater than 0, then M4 Core will periodically ping the MySQL server to keep connections alive. Value (in seconds) defines how often to ping the MySQL server.
  • prefix_handle - controls which prefix is saved to the database (statistics depend on prefixes so this variable changes how statistics are presented). Accepted values are default, originator, terminator. The default value is default which tells the core to save the longest prefix from both Originator's and Terminator's tariffs. Value originator tells core to save prefix that was used from Originator's Tariff (statistics will be presented from Originator's perspective). The value terminator tells core to save the prefix that was used from Terminator's Tariff (statistics will be presented from Terminator's perspective).
  • dial_peers_by_originator_prefix - Default 0. If 1, then Dial Peers will be searched by selected prefix from the originator tariff. If 0, then Dial Peers are searched by the longest matching prefix.
  • non_blocking_balance - Default 0. If > 0, then it activates the new balance update mechanics which updates the User's balance every X seconds, where X is the value of this setting. Eg. non_blocking_balance = 10, will update balances every 10s. Setting can help with high system load when Concurrent Calls > 4000 / CPS > 150. With a lower load on the server, this setting will not be useful.
  • disable_advanced_routing - Default 0. If 1 - the core will not calculate quality statistics for Quality Routing. Disable this option if you are not using Quality Routing.
  • show_entity_names - default 0. Shows entity names in the core log if enabled. Tariffs, DPs, TPs, OPs, RGs. Good for easier/faster troubleshooting. Slightly decreases core performance.

Cache

  • cp_index_update_period - Default 60. How often to refresh Users/Connection Points cache. Min value 10.
  • tariff_update_period - Default 60. How often to refresh Tariffs cache. Min value 10.
  • dp_cache_update_period - Default 60. How often to refresh Dial Peers cache. Min value 10.
  • dids_update_period - Default 60. How often to refresh DIDs cache. Min value 10.
  • flatrates_update_period - Default 60. How often to refresh Flat-Rates cache. Min value 10.
  • subscriptions_update_period - Default 60. How often to refresh Subscriptions cache. Min value 10.
  • balance_update_period - Default 5. How often to update User Balances to database.

Billing

  • cli_groups_recursive_match - If enabled (value 1), CLI groups will be searched and matched recursively. For example, if longest matching destination prefix is 3706, but there is no CLI match for this destination, then shorter destination prefix 370 will be checked for CLI match. If disabled (value 0), then only longest destination prefix will be checked for CLI match. If there is no CLI match for longest destination prefix, rate will not be found. Default 0.

Radius Log

  • show_debug = default 0. If 0, then DEBUG messages will not be written in /var/log/radius/radiusd.log
  • show_notice = default 1. If 0, then NOTICEmessages will not be written in /var/log/radius/radiusd.log
  • show_warning = default 1. If 0, then WARNING messages will not be written in /var/log/radius/radiusd.log
  • show_error = default 1. If 0, then ERROR messages will not be written in /var/log/radius/radiusd.log
  • show_sql = default 0. If 1, then full SQLs will be written in /var/log/radius/radiusd.log (used in debugging)
  • show_slow_sql = default 1. If 0, then slow SQLs will not be written in /var/log/radius/radiusd.log
  • no_uniqueid_in_log - Default 0. If 1, then no unique id will be written into radius.log. Used in development to save screen space.

CDR

  • cdr_batch_size – after the call end, cdr is stored in a buffer and when that buffer is full, all CDRs are flushed to the database. This variable defines how many CDRs are buffered before flushing to the database. The default value is 30 (after 30 calls all CDRs will be flushed to the database). The Max value is 100.
  • cdr_flush_time – cdr buffer is periodically flushed to the database. This variable defines how often to flush the cdr buffer to the database (value is in seconds). The default value is 60 seconds (after 60 seconds, all CDRs will be flushed to the database, no matter how many calls are buffered)
  • do_not_log_cached_cdrs - Default 1. If 1, then M4 will not log CDRs refused by the cache. This is the recommended setting because there is no need to write all the failed CDRs to DB when one is enough to identify the cause of call failure.
  • do_not_log_system_cdrs - Default 0. If 1, then M4 will not write FAILED CDRs with HGC >= 300. Use this option if you don't need such CDRs, it will slightly improve system performance.
  • do_not_log_failed_cdrs - Default 0. If 1, then M4 will not write FAILED CDRs to the database. Use this option if you don't need FAILED CDRs, it will slightly improve system performance.
  • log_only_last_cdr - Default 0. If 1, then M4 logs only the last CDR for the Call. M4 will not log failed attempts to terminators until the call goes over the last one. Only one CDR is logged for the call. It can be used to improve system performance.

HGC

  • enforced_global_hgc – set specific hangup cause for all failed, busy, and no-answer calls. Only answered calls will return default 16 hangup cause. For example enforced_global_hgc = 34 will return 503 Service Unavailable to the originator for all non-answered calls.
  • reroute_stop_hgc - List of hangup cause codes (ISDN codes for M4, SIP codes for M4) that should stop rerouting through other terminators. If the terminator returns a code that is specified in the reroute_stop_hgc setting, the core will skip other terminators in the routing list. Multiple causes can be specified by separating them with a comma separator, for example, reroute_stop_hgc = 1,2,3 (for M4) or reroute_stop_hgc = 408,500,603 (for M4)
  • change_failed_16_to - allows to change FAILED(16) hangup cause to another hangup cause, for example FAILED(34). Accepted values are between 1 and 127 (ISDN codes).

MNP

  • mnp_enabled - Default 0. If 1, then MNP will be enabled in the core.
  • mnp_update_period - Default 120. How often to update MNP settings (DB configs, Prefixes)
  • mnp_down_continue_call - Default 1. Should we continue calling if MNP fails?
  • mnp_timeout_count_before_hold - Default 3. How many timeouts should we receive before pausing the MNP check
  • mnp_hold_time - Default 30. For how long should we stop MNP checks after N timeouts
  • db_mnp_connections - How many MySQL connections will be created for the MNP database. The default number of connections is the number of CPU core count
  • db_mnp_connections_timeout - Timeout for MNP database connections. Default 1 sec.

Destination DDoS protection


Global settings

Global Destination DDoS settings will apply to all Users.

  • dst_ddos_check_enabled - Default 0. If set to 1, enables or disables DDoS protection for destination numbers. Set to 1 to enable. When enabled, the system temporarily blocks a destination number if it receives dst_ddos_calls calls within dst_ddos_check_period seconds. The block lasts for dst_ddos_reject_time seconds (block the number for X seconds if more than Y call attempts within Z seconds). Blocking is applied globally.
  • dst_ddos_calls - Default 10. The number of calls within the check period (dst_ddos_check_period) that triggers the DDoS protection block.
  • dst_ddos_check_period - Default 60. The time window (in seconds) during which the number of calls is monitored for DDoS protection.
  • dst_ddos_reject_time - Default 60. The duration (in seconds) for which a destination number is blocked after the DDoS protection is triggered. After this time, calls to the destination number are allowed again.
  • dst_ddos_number_pool_id - Default 0. Number pool id which is used to store blocked numbers permanently.
  • dst_ddos_reuse_cli - Default 0. If set to 1, enables to reuse the same CLI (that was sent to TP) for all successive calls to the same destination number. Reused CLI is reset after dst_ddos_check_period. This option can be useful when using Random CallerID from Number Pool feature as it "assigns" the same CLI (that was initially picked randomly) for all calls to the same destination number during dst_ddos_check_period.
  • dst_ddos_reset_cli_on_answer - Default 0. If set to 1, adds an additional condition for resetting CLI in option dst_ddos_reuse_cli. When both dst_ddos_reuse_cli and dst_ddos_reset_cli_on_answer are enabled, reused CLI is reset either when dst_ddos_check_period ends or when the call is answered.


Specific Destination DDoS profiles

Different Destination DDoS profiles can be created and assigned to specific User or Users by adding settings with _profile_X_:

  • dst_ddos_profile_X_users - comma separated list of User IDs (for example dst_ddos_profile_X_users = 1, 25, 33). This Destination DDoS profile will apply only to Users listed in this setting. Global Destination DDoS settings will not apply to Users in this list, only this specific profile will be used.
  • dst_ddos_profile_X_check_enabled - Description in global settings.
  • dst_ddos_profile_X_calls - Description in global settings.
  • dst_ddos_profile_X_check_period - Description in global settings.
  • dst_ddos_profile_X_reject_time - Description in global settings.
  • dst_ddos_profile_X_number_pool_id - Description in global settings.
  • dst_ddos_profile_X_reuse_cli - Description in global settings.
  • dst_ddos_profile_X_reset_cli_on_answer - Description in global settings.


Here X is a number between 1 and 99 (max 99 profiles can be created). For example, to create two different profiles, add:

# Comment - profile 1 for users 1, 2, 3 that reuses CLI and allows 10 calls before reject
dst_ddos_profile_1_users = 1, 2, 3
dst_ddos_profile_1_check_enabled = 1
dst_ddos_profile_1_calls = 10
dst_ddos_profile_1_reuse_cli = 1
...

# Comment - profile 2 for users 25, 450 that allows 30 calls before reject
dst_ddos_profile_2_users = 25, 450
dst_ddos_profile_2_check_enabled = 1
dst_ddos_profile_2_calls = 30
...

# Comment - profile 3 to exclude user 4 from global Destination DDoS settings (when global dst_ddos_check_enabled is enabled) - no checks will be performed for this user
dst_ddos_profile_3_users = 4
dst_ddos_profile_3_check_enabled = 0

Scripts

  • invoice_generate_wait_time - how many hours the system should wait before the Invoice is generated automatically. The default value is 6 hours. Acceptable values are 0 - 23. Since CDRs are created after the call ends, we need to wait some time before generating an Invoice. For example, if the call starts at 23:55:00 and lasts more than 5 minutes, we cannot generate an invoice at midnight because this call will not be included in the Invoice. Wait time allows postponing Invoice generate event.
  • terminator_check_bind_ip - bind on specific IP when checking Terminator availability.
  • calls_archiving_report_inconsistencies - should we report inconsistencies in CDR archiving via email? Default 1.
  • calls_archiving_report_inconsistencies_email - email where to send CDR archiving inconsistencies. Default support@kolmisoft.com.

Kamailio

  • kamailio_disable_full_lr - Default 0. If set to 1, then ";lr" instead of ";lr=on" will be used when generating SIP Record header.
  • reject_duplicate_calls - Default 0. If set to 1, then duplicate calls will be rejected (simultaneous calls from the same source number to the same destination number).
  • duplicate_call_id_check - Default 1. If set to 1, then duplicate Call-ID (SIP header) check is enabled. If another call with the same Call-ID comes to system within 60 seconds, it will be rejected. If set to 0, this check is disabled, and duplicate Call-ID headers are allowed.
  • kamailio_media_servers - By default this variable is not present and all active media servers set in GUI MAINTENANCE-> Servers are included in the Kamailio config. If you want to restrict Kamailio config for specific RTPE servers, add RTPE server ids in this variable. For example, with kamailio_media_servers = 3, 4 only RTPE servers with ids 3 and 4 will be included (if they exist in DB) in the Kamailio config.
  • kamailio_disable_rtcp - Default 0. If set to 1, disables RTCP (a=rtcp:xxxx line in SDP).
  • kamailio_allow_asymmetric_codecs - Default 0. If set to 1, mismatched SDP payload type numbers are accepted and honoured. For example, when OP send telephone-event with payload type 96 and TP answers with telephone-event payload 101, M4 sends telephone-event with payload type 101 back to OP, when this setting is enabled. If this setting is not enabled, then M4 handles these codecs as non matching and no telephone-event is send back to OP. This applies to all dynamic payload types (like OPUS), not just telephone-event.

SEMS

  • sems_kolmisoft_ack_fix - Default no. If set to yes, the Kolmisoft SEMS ACK fix is activated. Variable (without sems_ prefix) will be added to /etc/sems/sems.conf file during SEMS update.


Make sure that the format is:

variable = value

Note that there are spaces around = symbol


When settings are changed, the core needs to be reloaded using the following command:

m2 reload

Note: for Kamailio specific settings, Kamailio reconfigure and restart is required (this will drop live calls on this Kamailio server!)

/usr/src/m4/kamailio/kamailio_cfg_update.sh
systemctl restart kamailio