Difference between revisions of "Mor.conf"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(116 intermediate revisions by 8 users not shown)
Line 1: Line 1:
This file is in '''/etc/asterisk/''' and describes some values for the app_mor.so application, which is the main MOR core working in the Asterisk environment.
__NOTOC__
This file is '''/etc/asterisk/mor.conf''' and describes some values for the app_mor.so application, which is the main MOR core working in the Asterisk environment.


=== Database ===
* '''hostname''' - database hostname. Default 'localhost'.
* '''dbname''' - database name. Default 'mor'.
* '''user''' - database user. Default 'mor'.
* '''password''' - database password. Default blank.
* '''port''' - database port. Default 3306.
* '''db_startup_retry''' - number of database connection attempts on Asterisk startup. If after N attempts, connection to the database is not established, Asterisk will exit. Default 10 retries.
* '''db_startup_retry_delay''' - how many seconds to wait before each database connection attempt. Default 10 seconds.


* '''hostname, dbname, user, password, port, sock''' – All these values describe connections to the database.
=== Various ===
* '''min_frozen''' – Minimum credit left to allow simultaneous calls. If the user's balance is lower, he will not be able to make simultaneous calls (default 10); ''Not used starting from MOR 0.7.''
* '''min_frozen''' – Minimum credit left to allow simultaneous calls. If the user's balance is lower, he will not be able to make simultaneous calls (default 10); ''Not used starting from MOR 0.7.''
* '''frozen_time''' – How much balance to be frozen in terms of minutes if the user is prepaid (default 30). If the user makes several simultaneous calls and is prepaid, we need to "freeze“ some amount to be safe. A more detailed explanation is in [[Prepaid Logic]].
* '''frozen_time''' – How much balance is to be frozen in terms of minutes if the user is prepaid (default 30). If the user makes several simultaneous calls and is prepaid, we need to "freeze“ some amount to be safe. A more detailed explanation is in [[Prepaid Logic]].
* '''show_notice, show_warning, show_error''' – Sets debug level for the app_mor.so application in Asterisk CLI.
* '''show_notice, show_warning, show_error''' – Sets debug level for the app_mor.so application in Asterisk CLI.
* '''zap_change''' – Change ZAP into something else in Asterisk to permit the use of some custom-made channels based on Zaptel.
* '''zap_change''' – Change ZAP into something else in Asterisk to permit the use of some custom-made channels based on Zaptel.
Line 13: Line 22:
* '''use_lcr_partials''' - Should MOR be able to use LCR by destinations? Default 1.
* '''use_lcr_partials''' - Should MOR be able to use LCR by destinations? Default 1.
* '''global_call_timeout''' - Global timeout for calls in seconds, default 7200 seconds (2h).
* '''global_call_timeout''' - Global timeout for calls in seconds, default 7200 seconds (2h).
* '''check_banned_clis''' - Should MOR check for banned CLIs? Default 1, Enables/Disables [[ANI/CLI ban system]] ''(available from [[MOR 8 documentation | MOR 8]])''.
* '''use_speed_dials''' - Should [[Speed Dials]] be enabled.
* '''server_ip''' - external server IP, default 127.0.0.1 (Used in [[P-Asserted-Identity]]).
* '''clean_destination''' - MOR cleans the destination and leaves only numeric values till a non-numeric symbol if a non-numeric symbol is found. For example, if the destination is entered as 1234.56789, only 1234 is left after cleaning. Default 1
* '''copy_diversion_to_dst''' - Copy number from Diversion header to SIP TO (destination number). Default 0.
* '''provider_loop_check''' - enables (by default) HGC 240 Provider Loop check
* '''hangup_when_star_pressed''' - Default 0. If 1, then pressing "*" in Calling Cards dial plan will drop the call to End IVR. If 0, then this feature is disabled.
* '''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.6 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.
* '''disable_calls_when_balance_empty''' - Default 0. If 1, then MOR will not allow Users to make calls even if the price for the destination is 0 (rate = 0).
* '''forwarding_enabled''' - Default 0. If 1, then changes forwarding behavior. Set to 1 only if you are having problems with forwarding.
* '''use_pause_code''' - Default 0. If 1, then MOR will check if the number contains a special character (default '''p''') followed by a number. For example 12345'''p'''370123. If the number matches this format, MOR will dial the first number (before the letter '''p''') and then instead of asking the user to enter the destination number MOR will dial the second number (after the letter '''p'''). The first number is usually an access number and the second number is the destination number. This feature allows skipping the "Please enter destination number" prompt and dials directly to a specified number.
* '''pause_code''' - set special character for '''use_pause_code''' setting. The default is '''p'''.
* '''mysql_ping''' - Default 0 (disabled). If the value is greater than 0, then MOR Core will periodically ping the MySQL server to keep connections alive. Value (in seconds) defines how often to ping the MySQL server.
* '''remove_mor_headers''' - Default 0 (disabled). If 1, then MOR will not send custom MOR headers (x-MOR-XXXXXX) to the provider. '''DO NOT ENABLE THIS OPTION ON SYSTEM WITH PROXY SERVER''' Those headers are needed so MOR could work with Proxy.
* '''provider_agi_script_path''' - Path to custom AGI script. More info [http://wiki.kolmisoft.com/index.php/Provider_AGI_script here].
* '''check_connection_fee_loss_call''' - Default 0. If 1, then MOR will not allow calling when the provider's connection fee is higher than the user's connection fee. This logic also applies to resellers and partners, for example, if the reseller's connection fee is higher than the partner's, MOR will not allow calling since the partner will have a loss call.
* '''disable_cc_empty_ivr''' - Default 0. If 1, then CC Empty IVR will be disabled. CC Empty IVR is executed when a client enters the PIN of the empty Card. This IVR allows to TopUp Card. If you want to disable TopUp for empty Cards, set disable_cc_empty_ivr to 1.
* '''pass_custom_headers''' - list of custom SIP headers that should be forwarded from originator to terminator. For example '''pass_custom_headers = x-My-Header, x_another_header''' will pass two custom headers ('''x-My-Header''' and '''x_another_header''') from originator to terminator. Multiple headers should be separated by a comma separator. '''Header names are case sensitive'''.
* '''pass_headers''' - same as '''pass_custom_headers'''.
* '''save_sip_call_id_to_database''' - Default 0. If 1, then legA and legB '''SIP''' Call-ID headers will be saved to the database (calls.lega_call_id and calls.legb_call_id). '''Only works on Asterisk 15 or newer'''.
* '''do_not_play_did_announcements''' - Default 0. If 1, then no announcements will be played at the end of DID call. By default announcements like "the number is unreachable", "the number is busy" are played at the end of DID call (if it was answered). This option allows disabling these announcements.
 
=== Recordings ===
* '''record_not_answered_calls''' - save the audio to the file while the channel is not answered (not bridged), default 0 (by default records only answered calls)
* '''recordings_copy_wav_to_dir''' - path where to copy WAV recordings (for example recordings_copy_wav_to_dir = /var/spool/asterisk/monitor/wav). In normal operation, MOR converts WAV recordings to MP3 and deletes WAV files from /var/spool/asterisk/monitor. This setting allows you to copy the WAV file to another directory before deleting from /var/spool/asterisk/monitor. By default, this option is empty - disabled.
* '''recordings_hdd_free_space_limit_gb''' - do not save recordings in the hard drive if free space limit (in gigabytes) is reached. For example, if set to value 5, recordings will not be saved to a hard drive when 5 or fewer gigabytes of free space are left.
* '''recordings_no_email_on_free_space_limit''' - if set to 1, recording will not be sent via email when the hard drive free space limit is reached. Default 0.
 
=== Flat Rates ===
* '''use_flat_rates''' - Should MOR use [[Flat-Rates]], default 1.
* '''use_flat_rates''' - Should MOR use [[Flat-Rates]], default 1.
* ''' use_speed_dials''' - Should [[Speed Dials]] be enabled.
* '''flatrate_check_period''' - Default 5. Time (in seconds) how often to check remaining time on Flat Rate calls (only relevant for simultaneous calls from the same user). To disable, set value to 0.
* '''server_ip''' - external server IP, default 127.0.0.1 (Used in [[P-Asserted-Identity]]).
* '''db_flatrate_check_period''' - Default 5. Time (in seconds) how often to synchronize Flat Rate check data between multiple servers (only relevant for multiserver systems).
* '''play_hgc_audio''' - Should we play audio with error message when call fails? (default 0 if not set).
* '''flatrate_check_hangup_when_left''' - Default 0. Usually, active Flat-Rate calls should be canceled when 0 seconds are left but Flat Rate check is not actually "realtime" (performed every X seconds) therefore depending on timing, Flat Rate seconds can go into negative value. This setting allows to terminate Flat Rate calls when X seconds are left, for example, terminate active Flat Rate calls when 60 seconds left. This setting is relevant only for simultaneous  calls from the same user or when Flat Rate calls are on different servers.
 
=== Callback ===
* '''use_callback_uniqueid'''  - Default 0. If 1, then callback uniqueid (both legA and legB have the same callback uniqueid) will be stored to 'calls' table, 'userfield' field. If you enable this feature, '''make sure your calls table has 'userfield' field!''' If [calls] table doesn't have this field, it should be added for this feature to work properly. Asterisk full restart is required.
* '''cc_callback_tariff_for_lega''' - Default 0. If 1, then callback user's tariff will be used to charge legA (only applies to callback by calling card number/pin)
* '''ani_callback_tariff_for_lega''' - Default 0. If 1, then callback user's tariff will be used to charge legA (only applies to callback by ANI)
* '''callback_lcr_for_lega''' - Default 0. If 1, then callback user's LCR will be used to make calls to legA.
 
=== CDRs ===
* '''cdr_batch_size''' - This variable defines how many calls should be buffered, before inserting them into the database. Buffered calls are inserted into the database in one batch. This feature reduces SQL requests and load on the database. The default value is 30 calls. If 0, then this feature is disabled.
* '''cdr_flush_time''' - This variable defines how often to flush calls from buffer to database (see cdr_batch_size). The default value is 5 seconds. Every 5 seconds buffer is flushed
* '''log_only_last_cdr''' - Default 0. If 1, then Core logs only the last CDR for the Call, e.g. it does not log failed attempts to use the first providers in the LCR until the call goes over the last one. E.g. only one CDR is logged for the call.
* '''do_not_log_mor_hgc''' - Default 0. If 1, then Core only logs calls whose HGC are < 200, e.g. not related to the MOR. This option applies only to NO LAST tries. e.g. last call try is ALWAYS logged no matter of HGC.
* '''do_not_log_failed_ad_cdrs''' - Default 0. If 1, then MOR will not save failed autodialer CDRs to database.
* '''do_not_log_mor_failed_cdrs''' - Default 0. If 1, then MOR will not write '''MOR specific''' failed CDRs to database. MOR specific failed CDRs are those which have failed code >= 200
* '''save_did_device_callerid_name_to_db''' - Default 0. If 1, then MOR will save DID Device CallerID '''name''' (if set in Device settings) to database.
 
=== Hangup Cause Codes (HGC) ===
* '''reroute_stop_hgc''' - List of hangup cause codes (ISDN codes, not SIP) that should stop rerouting through other providers. If the provider returns a code that is specified in the reroute_stop_hgc setting, the core will skip other providers in LCR. Multiple causes can be specified by separating them with a comma separator, for example, reroute_stop_hgc = 1,2,3
* '''play_hgc_audio''' - Should we play audio with an error message when a call fails? (default 0 if not set).
** If it is equal to 1, then sound files will be played for error codes 200 and higher
** If it is equal to 1, then sound files will be played for error codes 200 and higher
** If it is equal to 2, then sound files will be played for ALL error codes (sound files for these error codes are not included into MOR) (''This option is available starting from [[MOR_10_documentation | MOR 10]]''.)
** If it is equal to 2, then sound files will be played for ALL error codes (sound files for these error codes are not included in MOR) (''This option is available starting from [[MOR_10_documentation | MOR 10]]''.)
* '''clean_destination''' - MOR cleans destination and leaves only numeric values. Example, if destination is entered as 1234.56789, only 1234 is left after cleaning. Default 1
* '''play_reseller_hgc_audio''' - Should we play Reseller specific HGC sound files? Reseller HGC sound files should be named in the following format: '''hgc_XXX_reseller_YYY'''. Here XXX is Hangup Cause Code (for example 201) and YYY is Reseller ID (for example 25). For this setting to work, '''play_hgc_audio''' or '''play_hgc_x''' must be enabled.
* '''pass_pai''' - When PAI comes from Caller should we pass it to Callee automatically? default no (0)  
* '''play_hgc_x''' - if you want to play audio with an error message on a specific hangup cause, replace '''x''' in play_hgc_'''x''' with a specific code (works with all HGC codes starting from 0). For example, if you want to play only ''211 Low balance for user'' error message, set ''play_hgc_211 = 1''. This option can also be used to exclude specific hangup codes when using the global ''play_hgc_audio'' setting. For example ''play_hgc_220 = 0'' will disable the audio error message for the 220 User call limit reached. Audio files should be located in /var/lib/asterisk/sounds/mor/hgc/. Default files can be downloaded from https://packets.kolmisoft.com/packets/mor_sounds_hgc.tgz. If you uploading your own files, make sure that format is correct (Bit rate: 16-bit, Sample rate: 8000Hz, MONO).
* '''pass_rpid'''  - When Remote-Party-ID comes from Caller should we pass it to Callee automatically? default no (0)  
* '''hgcX''' = code, sets ISDN code for [[Hangupcause Codes|MOR HGC]], where X >= 200 and code - some integer value, from ISDN codes, example: hgc203 = 34 sets ISDN code 34 for MOR HGC 203. If no values are set - default ones will be used. To enable HGC mapping for provider-related causes, disable_provider_hgc_mapping should be set to 0 (this setting is described below)
* '''disable_provider_hgc_mapping''' - Default 1. If 0, then Core is allowed to modify the ISDN code based on MOR HGC (only for provider-related HGC). If 1, then Core will use the last ISDN code which is set by Asterisk (this will reflect the real cause of why the provider failed).
* '''change_failed_16_to''' - allows to change FAILED(16) hangupcause to another hangupcause, for example FAILED(34). Accepted values are between 1 and 127 (ISDN codes).
* '''ringing_timeout_hgc''' - Default 0 (disabled). This can be set to a specific ISDN code which will be used to send a response back to the originator when a ringing timeout is reached on the provider side. Usually, this should be set to ISDN code 19 (this translates to SIP 480). In this case, when the ringing timeout is reached on the provider side, the originator should receive the SIP 480 response instead of the default SIP 603. Set ringing_timeout_hgc=19 if you want to send the caller code 480 (instead of default 603).
 
=== Headers (General) ===
 
* '''auth_by_headers''' - Default disabled. List of SIP headers (in order) to use for ANI authentication. First non-empty, non-anonymous CallerID will be used for ANI authentication. For example auth_by_headers=Remote-Party-ID,P-Charge-Info,P-Asserted-Identity,Diversion,From will check headers in order: first checks Remote-Party-ID, if it is anonymous, P-Asserted-Identity will be checked, and so on until valid CallerID is found. If none of the headers are selected for ANI authentication, then normal ANI authentication flow will be performed (ANI by SIP From).
** This option replaces auth_by_ppi and auth_by_divfromrpidpai options and has higher priority if any of these older options are enabled.
** This option does not change CallerID (from From: header) that will be sent to the core for [[Number Manipulation]] and then to the Providers.
** Localization Rules are applied to the number from the selected header.
 
=== Remote-Party-ID (RPID) ===
* '''pass_rpid'''  - When Remote-Party-ID comes from the Caller should we pass it to Callee automatically? default no (0)  
* '''localize_rpid'''  - When Remote-Party-ID comes from Caller should we localize RPID number by CallerID localization rules? default no (0). Only works if pass_rpid is enabled.
* '''localize_rpid'''  - When Remote-Party-ID comes from Caller should we localize RPID number by CallerID localization rules? default no (0). Only works if pass_rpid is enabled.
* '''record_not_answered_calls''' - save audio to the file while the channel is not answered (not bridged), default 0 (by default records only answered calls)
* '''anonymous_callerid_by_rpidpai''' - Default 0. If 1, then 'anonymous' CallerID will be changed to CallerID from 'Remote-Party-ID' or 'P-Asserted-Identity' headers (unless they are absent or also 'anonymous'). If original CallerID is not 'anonymous', then this option will not change CallerID . This option only works if 'use_callerid_from_pai' is disabled.
** '''anonymous_callerid_by_rpidpai_keywords''' - usable only when '''anonymous_callerid_by_rpidpai''' is enabled. This setting extends '''anonymous_callerid_by_rpidpai''' functionality and allows to define list of keywords which will be used along with 'anonymous' keyword. You can set multiple keywords by separating them with comma, for example '''anonymous_callerid_by_rpidpai_keywords = anonymous, invalid, unknown'''.
** '''empty_callerid_by_rpidpai''' -  usable only when '''anonymous_callerid_by_rpidpai''' is enabled. Disabled if set to 0. If set to 1, then this setting extends '''anonymous_callerid_by_rpidpai''' functionality and allows to change '''empty''' CallerID.
* '''internal_anonymous_callerid_by_rpidpai''' - Default 0. Works in a similar way to '''anonymous_callerid_by_rpidpai''' except that CallerID will stay anonymous when call leaves MOR. All internal operations related to CallerID (for example localization) will be done on a number from RPID/PAI.
* '''auth_by_divfromrpidpai''' - Default 0. If 1, then authentication by CallerID (ANI, pinless dialing) will use CallerID from these headers: Diversion, From, Remote-Party-ID or P-Asserted-Identity. The diversion has the highest priority and P-Asserted-Identity has the lowest priority. First non-empty, non-anonymous CallerID will be used to authenticate the user/calling card. '''Original CallerID will not be changed.''' CallerID from these headers will only be used to authenticate the user. Location rules will be applied to this CallerID.
 
=== P-Asserted-Identity (PAI) ===
* '''pass_pai'''  - When PAI comes from the Caller should we pass it to Callee automatically? default no (0). If pass_pai = 0 and PAI usage in provider settings = 1, then the core will add PAI header.
* '''pass_pai_with_server_ip''' - Default 0. If 1, then IP address in original PAI header will be replaced with IP address of MOR server. Works only when '''pass_pai''' in mor.conf or '''Pass PAI''' in device settings is enabled.
* '''use_callerid_from_pai''' - Default 0. If 1, then CallerID from P-Asserted-Identity (PAI) header will be used instead of FROM header CallerID.
* '''set_original_source_in_pai''' - Default 0. If 1, then original source number will be used to construct PAI header (when '''P-Asserted-Identity usage''' is enabled in Provider settings). This allows to set "anonymous" source number in SIP FROM field (Provider CallerID) and pass original source number in PAI header.
* '''use_pai_if_callerid_anonymous''' - Default 1. If 1, then MOR will change anonymous CallerID to number from PAI when pass_pai is enabled. If 0, then MOR will pass anonymous CallerID to Provider.
 
=== P-Preferred-Identity (PPI) ===
* '''use_callerid_from_ppi''' - Default 0. If 1, then CallerID from P-Preferred-Identity (PPI) header will be used instead of FROM header CallerID.
* '''auth_by_ppi''' - Default 0. If 1, then ANI/pinless authentication will use CallerID from P-Preferred-Identity. Original CallerID will not be changed. CallerID from this header will be used only to authenticate the user.
 
=== CallerID, Privacy ===
* '''use_valid_callerid''' - Default 0. If 1, then MOR should check if the callerid is valid (contains only numbers). If the option is enabled and callerid is invalid, then MOR will overwrite it with callerid from device settings. If the callerid in device settings is empty or invalid, then the callerid will not be changed. This option can be used to prevent 'anonymous' callerid in cdr.
* '''global_cli_auth''' - Default 1. If 1, then authentication by callerid is global. For example, if reseller's user calls to admin's did, which is assigned to auth by ani dialplan, then this user can be authenticated and vice versa - if admin's user calls to reseller's did, which is assigned to auth by ani dialplan, then this user can be authenticated. This logic also applies when one reseller's user calls to another reseller did. When this option is set to 0, users can be authenticated by callerid only when calling to its owner's DID assigned to 'auth by ani dialplan'.
* '''callerid_control_by_best_matching_destination''' - Default 0. If enabled, changes behavior of 'CallerID Control by Destination' to search for '''best matching''' (by prefix) DID instead of '''nearest''' DID. If enabled and no matching prefix is found, then the '''nearest''' DID will be matched. Algorithm for '''nearest match''' described [[Device_settings#CallerID | here]] in '''Control by Destination''' section.
* '''pass_anonymous_domain''' - Default 0. If enabled and originator is sending anonymous domain in SIP header From: <xxxxxx@'''anonymous.invalid'''>, pass it to terminator.
* '''send_privacy_id_for_anonymous_calls''' - Default 0. If 1, then MOR will add '''Privacy: id''' header when originator is sending '''anonymous''' callerid.
* '''pass_privacy_header''' - When Privacy comes from the Caller should we pass it to Callee automatically? default no (0)
* '''set_diversion_by_callerid''' - Default 0. If 1, then the SIP Diversion number part will be replaced by a number from the SIP From header. If the originator is not sending the Diversion header, this option has no effect.
* '''check_banned_clis''' - Should MOR check for banned CLIs? Default 1, Enables/Disables [[ANI/CLI ban system]].
* '''cid_by_dids_before_localization''' - Default 0. If 1, then '''CallerID Control by DIDs (CID from DIDs)''' is executed before Localization. By default '''CallerID Control by DIDs (CID from DIDs)''' is executed after Localization (cid_by_dids_before_localization = 0).
* '''copy_legA_name_to_legA_number''' - Default 0. If enabled, changes Device setting '''Copy Leg A Name to Leg B Number''' to apply on Leg A (instead of Leg B). This way localizations, blacklisting, and other functions will use a new CallerID Number (CallerID Name, which is copied to Number). Works only if Device has enabled setting '''Copy Leg A Name to Leg B Number'''.
* '''allow_empty_cid_name''' - (only on Asterisk 15) Default 1. If enabled (set to 1), Asterisk allows to send empty CID name to providers (for example, From: <sip:370000@host>). If disabled (set to 0), Asterisk will not allow to send empty CID name. In that case, Asterisk sets CID name as CID number (for example, From: "370000" <sip:370000@host>). This option mimics Asterisk 1.8 behavior where is not allowed to send empty CID name.
* '''clean_callerid''' - Default 0. If enabled (set to 1), then incoming CallerID will be cleaned (everything from ; symbol will be cut). For example, if incoming CallerID is <sip:3700000;tag=yyyyy@host>, then after cleaning it, only the number part "3700000" (;tag=yyyyy will be cut) will be used.


* '''hgcX''' = code, sets ISDN code for [[Hangupcause Codes|MOR HGC]], where X >= 200 and code - some integer value, from ISDN codes, example: hgc203 = 34 sets ISDN code 34 for MOR HGC 203. If no values are set - default ones will be used. To enable hgc mapping for provider related causes, disable_provider_hgc_mapping should be set to 0 (this setting is described below)
=== MNP ===
* '''log_only_last_cdr''' - Default 0. If 1, then Core logs only last CDR for the Call, e.g. it does not log failed attempts to use first providers in the LCR until call goes over the last one. E.g. only one CDR is logged for the call.
* '''mnp_enabled''' - Default 0. If enabled (set to 1), then [[Mobile_Number_Portability_Addon|MNP]] check will be performed on each call.
* '''do_not_log_mor_hgc''' - Default 0. If 1, then Core only logs calls which HGC are < 200, e.g. not related to the MOR. This option applies only to NO LAST tries. e.g. last call try is ALWAYS logged no matter of HGC.
* '''provider_loop_check''' - enables (by default) HGC 240 Provider Loop check
* '''disable_provider_hgc_mapping''' - Default 1. If 0, then Core is allowed to modify ISDN code based on MOR HGC (only for provider related HGC). If 1, then Core will use last ISDN code which is set by Asterisk (this will reflect real cause why provider failed).
* '''hangup_when_star_pressed''' - Default 0. If 1, then pressing "*" in Calling Cards dial plan will drop the call to End IVR. If 0, then this feature is disabled.
* '''use_valid_callerid''' - Default 0. If 1, then MOR should check if callerid is valid (contains only numbers). If option is enabled and callerid is invalid, then MOR will overwrite it with callerid from device settings. If callerid in device settings is empty or invalid, then callerid will not be changed. This option can be used to prevent 'anonymous' callerid in cdr.
* '''use_callerid_from_pai''' - Default 0. If 1, then CallerID from PAI header will be used instead of FROM header CallerID.
* '''anonymous_callerid_by_rpidpai''' - Default 0. If 1, then 'anonymous' CallerID will be changed to CallerID from 'Remote-Party-ID' or 'P-Asserted-Identity' headers (unless they are absent or also 'anonymous'). If original CallerID is not 'anonymous', then this option will not change CallerID . This option only works if 'use_callerid_from_pai' is disabled.
* '''auth_by_divfromrpidpai''' - Default 0. If 1, then authentication by CallerID (ANI, pinless dialing) will use CallerID from these headers: Diversion, From, Remote-Party-ID or P-Asserted-Identity. Diversion has the highest priority and P-Asserted-Identity has the lowest priority. First non empty, non anonymous CallerID will be used to authenticate user/calling card. '''Original CallerID will not be changed.''' CallerID from these headers will only be used to authenticate user. Location rules will be applied to this CallerID.
* '''global_cli_auth''' - Default 1. If 1, then authentication by callerid is global. For example, if reseller's user calls to admin's did, which is assigned to auth by ani dialplan, then this user can be authenticated and vice versa - if admin's user calls to reseller's did, which is assigned to auth by ani dialplan, then this user can be authenticated. This logic also applies when one reseller's user calls to another reseller's did. When this option is set to 0, users can be authenticated by callerid only when calling to its owner's did, assigned to auth by ani dialplan.
* '''use_callback_uniqueid'''  - Default 0. If 1, then callback uniqueid (both legA and legB have the same callback uniqueid) will be stored to 'calls' table, 'userfield' field. If you enable this feature, make sure your calls table has 'userfield' field. If calls table doesn't have this field, it should be added for this feature to work properly.
* '''cc_callback_tariff_for_lega''' - Default 0. If 1, then callback user's tariff will be used to charge legA (only applies to callback by calling card number/pin)


<br><br>
<br><br>

Latest revision as of 13:08, 2 August 2024

This file is /etc/asterisk/mor.conf and describes some values for the app_mor.so application, which is the main MOR core working in the Asterisk environment.

Database

  • hostname - database hostname. Default 'localhost'.
  • dbname - database name. Default 'mor'.
  • user - database user. Default 'mor'.
  • password - database password. Default blank.
  • port - database port. Default 3306.
  • db_startup_retry - number of database connection attempts on Asterisk startup. If after N attempts, connection to the database is not established, Asterisk will exit. Default 10 retries.
  • db_startup_retry_delay - how many seconds to wait before each database connection attempt. Default 10 seconds.

Various

  • min_frozen – Minimum credit left to allow simultaneous calls. If the user's balance is lower, he will not be able to make simultaneous calls (default 10); Not used starting from MOR 0.7.
  • frozen_time – How much balance is to be frozen in terms of minutes if the user is prepaid (default 30). If the user makes several simultaneous calls and is prepaid, we need to "freeze“ some amount to be safe. A more detailed explanation is in Prepaid Logic.
  • show_notice, show_warning, show_error – Sets debug level for the app_mor.so application in Asterisk CLI.
  • zap_change – Change ZAP into something else in Asterisk to permit the use of some custom-made channels based on Zaptel.
  • server_id – Unique number for server identification.
  • active_calls – Tells app_mor.so to update info to DB related to calls currently on the system.
  • dial_out_settings – Global settings for Dial() command in Asterisk (rTt or similar).
  • serial – Serial key for activating app_mor.so.
  • use_lcr_partials - Should MOR be able to use LCR by destinations? Default 1.
  • global_call_timeout - Global timeout for calls in seconds, default 7200 seconds (2h).
  • use_speed_dials - Should Speed Dials be enabled.
  • server_ip - external server IP, default 127.0.0.1 (Used in P-Asserted-Identity).
  • clean_destination - MOR cleans the destination and leaves only numeric values till a non-numeric symbol if a non-numeric symbol is found. For example, if the destination is entered as 1234.56789, only 1234 is left after cleaning. Default 1
  • copy_diversion_to_dst - Copy number from Diversion header to SIP TO (destination number). Default 0.
  • provider_loop_check - enables (by default) HGC 240 Provider Loop check
  • hangup_when_star_pressed - Default 0. If 1, then pressing "*" in Calling Cards dial plan will drop the call to End IVR. If 0, then this feature is disabled.
  • 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.6 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.
  • disable_calls_when_balance_empty - Default 0. If 1, then MOR will not allow Users to make calls even if the price for the destination is 0 (rate = 0).
  • forwarding_enabled - Default 0. If 1, then changes forwarding behavior. Set to 1 only if you are having problems with forwarding.
  • use_pause_code - Default 0. If 1, then MOR will check if the number contains a special character (default p) followed by a number. For example 12345p370123. If the number matches this format, MOR will dial the first number (before the letter p) and then instead of asking the user to enter the destination number MOR will dial the second number (after the letter p). The first number is usually an access number and the second number is the destination number. This feature allows skipping the "Please enter destination number" prompt and dials directly to a specified number.
  • pause_code - set special character for use_pause_code setting. The default is p.
  • mysql_ping - Default 0 (disabled). If the value is greater than 0, then MOR Core will periodically ping the MySQL server to keep connections alive. Value (in seconds) defines how often to ping the MySQL server.
  • remove_mor_headers - Default 0 (disabled). If 1, then MOR will not send custom MOR headers (x-MOR-XXXXXX) to the provider. DO NOT ENABLE THIS OPTION ON SYSTEM WITH PROXY SERVER Those headers are needed so MOR could work with Proxy.
  • provider_agi_script_path - Path to custom AGI script. More info here.
  • check_connection_fee_loss_call - Default 0. If 1, then MOR will not allow calling when the provider's connection fee is higher than the user's connection fee. This logic also applies to resellers and partners, for example, if the reseller's connection fee is higher than the partner's, MOR will not allow calling since the partner will have a loss call.
  • disable_cc_empty_ivr - Default 0. If 1, then CC Empty IVR will be disabled. CC Empty IVR is executed when a client enters the PIN of the empty Card. This IVR allows to TopUp Card. If you want to disable TopUp for empty Cards, set disable_cc_empty_ivr to 1.
  • pass_custom_headers - list of custom SIP headers that should be forwarded from originator to terminator. For example pass_custom_headers = x-My-Header, x_another_header will pass two custom headers (x-My-Header and x_another_header) from originator to terminator. Multiple headers should be separated by a comma separator. Header names are case sensitive.
  • pass_headers - same as pass_custom_headers.
  • save_sip_call_id_to_database - Default 0. If 1, then legA and legB SIP Call-ID headers will be saved to the database (calls.lega_call_id and calls.legb_call_id). Only works on Asterisk 15 or newer.
  • do_not_play_did_announcements - Default 0. If 1, then no announcements will be played at the end of DID call. By default announcements like "the number is unreachable", "the number is busy" are played at the end of DID call (if it was answered). This option allows disabling these announcements.

Recordings

  • record_not_answered_calls - save the audio to the file while the channel is not answered (not bridged), default 0 (by default records only answered calls)
  • recordings_copy_wav_to_dir - path where to copy WAV recordings (for example recordings_copy_wav_to_dir = /var/spool/asterisk/monitor/wav). In normal operation, MOR converts WAV recordings to MP3 and deletes WAV files from /var/spool/asterisk/monitor. This setting allows you to copy the WAV file to another directory before deleting from /var/spool/asterisk/monitor. By default, this option is empty - disabled.
  • recordings_hdd_free_space_limit_gb - do not save recordings in the hard drive if free space limit (in gigabytes) is reached. For example, if set to value 5, recordings will not be saved to a hard drive when 5 or fewer gigabytes of free space are left.
  • recordings_no_email_on_free_space_limit - if set to 1, recording will not be sent via email when the hard drive free space limit is reached. Default 0.

Flat Rates

  • use_flat_rates - Should MOR use Flat-Rates, default 1.
  • flatrate_check_period - Default 5. Time (in seconds) how often to check remaining time on Flat Rate calls (only relevant for simultaneous calls from the same user). To disable, set value to 0.
  • db_flatrate_check_period - Default 5. Time (in seconds) how often to synchronize Flat Rate check data between multiple servers (only relevant for multiserver systems).
  • flatrate_check_hangup_when_left - Default 0. Usually, active Flat-Rate calls should be canceled when 0 seconds are left but Flat Rate check is not actually "realtime" (performed every X seconds) therefore depending on timing, Flat Rate seconds can go into negative value. This setting allows to terminate Flat Rate calls when X seconds are left, for example, terminate active Flat Rate calls when 60 seconds left. This setting is relevant only for simultaneous calls from the same user or when Flat Rate calls are on different servers.

Callback

  • use_callback_uniqueid - Default 0. If 1, then callback uniqueid (both legA and legB have the same callback uniqueid) will be stored to 'calls' table, 'userfield' field. If you enable this feature, make sure your calls table has 'userfield' field! If [calls] table doesn't have this field, it should be added for this feature to work properly. Asterisk full restart is required.
  • cc_callback_tariff_for_lega - Default 0. If 1, then callback user's tariff will be used to charge legA (only applies to callback by calling card number/pin)
  • ani_callback_tariff_for_lega - Default 0. If 1, then callback user's tariff will be used to charge legA (only applies to callback by ANI)
  • callback_lcr_for_lega - Default 0. If 1, then callback user's LCR will be used to make calls to legA.

CDRs

  • cdr_batch_size - This variable defines how many calls should be buffered, before inserting them into the database. Buffered calls are inserted into the database in one batch. This feature reduces SQL requests and load on the database. The default value is 30 calls. If 0, then this feature is disabled.
  • cdr_flush_time - This variable defines how often to flush calls from buffer to database (see cdr_batch_size). The default value is 5 seconds. Every 5 seconds buffer is flushed
  • log_only_last_cdr - Default 0. If 1, then Core logs only the last CDR for the Call, e.g. it does not log failed attempts to use the first providers in the LCR until the call goes over the last one. E.g. only one CDR is logged for the call.
  • do_not_log_mor_hgc - Default 0. If 1, then Core only logs calls whose HGC are < 200, e.g. not related to the MOR. This option applies only to NO LAST tries. e.g. last call try is ALWAYS logged no matter of HGC.
  • do_not_log_failed_ad_cdrs - Default 0. If 1, then MOR will not save failed autodialer CDRs to database.
  • do_not_log_mor_failed_cdrs - Default 0. If 1, then MOR will not write MOR specific failed CDRs to database. MOR specific failed CDRs are those which have failed code >= 200
  • save_did_device_callerid_name_to_db - Default 0. If 1, then MOR will save DID Device CallerID name (if set in Device settings) to database.

Hangup Cause Codes (HGC)

  • reroute_stop_hgc - List of hangup cause codes (ISDN codes, not SIP) that should stop rerouting through other providers. If the provider returns a code that is specified in the reroute_stop_hgc setting, the core will skip other providers in LCR. Multiple causes can be specified by separating them with a comma separator, for example, reroute_stop_hgc = 1,2,3
  • play_hgc_audio - Should we play audio with an error message when a call fails? (default 0 if not set).
    • If it is equal to 1, then sound files will be played for error codes 200 and higher
    • If it is equal to 2, then sound files will be played for ALL error codes (sound files for these error codes are not included in MOR) (This option is available starting from MOR 10.)
  • play_reseller_hgc_audio - Should we play Reseller specific HGC sound files? Reseller HGC sound files should be named in the following format: hgc_XXX_reseller_YYY. Here XXX is Hangup Cause Code (for example 201) and YYY is Reseller ID (for example 25). For this setting to work, play_hgc_audio or play_hgc_x must be enabled.
  • play_hgc_x - if you want to play audio with an error message on a specific hangup cause, replace x in play_hgc_x with a specific code (works with all HGC codes starting from 0). For example, if you want to play only 211 Low balance for user error message, set play_hgc_211 = 1. This option can also be used to exclude specific hangup codes when using the global play_hgc_audio setting. For example play_hgc_220 = 0 will disable the audio error message for the 220 User call limit reached. Audio files should be located in /var/lib/asterisk/sounds/mor/hgc/. Default files can be downloaded from https://packets.kolmisoft.com/packets/mor_sounds_hgc.tgz. If you uploading your own files, make sure that format is correct (Bit rate: 16-bit, Sample rate: 8000Hz, MONO).
  • hgcX = code, sets ISDN code for MOR HGC, where X >= 200 and code - some integer value, from ISDN codes, example: hgc203 = 34 sets ISDN code 34 for MOR HGC 203. If no values are set - default ones will be used. To enable HGC mapping for provider-related causes, disable_provider_hgc_mapping should be set to 0 (this setting is described below)
  • disable_provider_hgc_mapping - Default 1. If 0, then Core is allowed to modify the ISDN code based on MOR HGC (only for provider-related HGC). If 1, then Core will use the last ISDN code which is set by Asterisk (this will reflect the real cause of why the provider failed).
  • change_failed_16_to - allows to change FAILED(16) hangupcause to another hangupcause, for example FAILED(34). Accepted values are between 1 and 127 (ISDN codes).
  • ringing_timeout_hgc - Default 0 (disabled). This can be set to a specific ISDN code which will be used to send a response back to the originator when a ringing timeout is reached on the provider side. Usually, this should be set to ISDN code 19 (this translates to SIP 480). In this case, when the ringing timeout is reached on the provider side, the originator should receive the SIP 480 response instead of the default SIP 603. Set ringing_timeout_hgc=19 if you want to send the caller code 480 (instead of default 603).

Headers (General)

  • auth_by_headers - Default disabled. List of SIP headers (in order) to use for ANI authentication. First non-empty, non-anonymous CallerID will be used for ANI authentication. For example auth_by_headers=Remote-Party-ID,P-Charge-Info,P-Asserted-Identity,Diversion,From will check headers in order: first checks Remote-Party-ID, if it is anonymous, P-Asserted-Identity will be checked, and so on until valid CallerID is found. If none of the headers are selected for ANI authentication, then normal ANI authentication flow will be performed (ANI by SIP From).
    • This option replaces auth_by_ppi and auth_by_divfromrpidpai options and has higher priority if any of these older options are enabled.
    • This option does not change CallerID (from From: header) that will be sent to the core for Number Manipulation and then to the Providers.
    • Localization Rules are applied to the number from the selected header.

Remote-Party-ID (RPID)

  • pass_rpid - When Remote-Party-ID comes from the Caller should we pass it to Callee automatically? default no (0)
  • localize_rpid - When Remote-Party-ID comes from Caller should we localize RPID number by CallerID localization rules? default no (0). Only works if pass_rpid is enabled.
  • anonymous_callerid_by_rpidpai - Default 0. If 1, then 'anonymous' CallerID will be changed to CallerID from 'Remote-Party-ID' or 'P-Asserted-Identity' headers (unless they are absent or also 'anonymous'). If original CallerID is not 'anonymous', then this option will not change CallerID . This option only works if 'use_callerid_from_pai' is disabled.
    • anonymous_callerid_by_rpidpai_keywords - usable only when anonymous_callerid_by_rpidpai is enabled. This setting extends anonymous_callerid_by_rpidpai functionality and allows to define list of keywords which will be used along with 'anonymous' keyword. You can set multiple keywords by separating them with comma, for example anonymous_callerid_by_rpidpai_keywords = anonymous, invalid, unknown.
    • empty_callerid_by_rpidpai - usable only when anonymous_callerid_by_rpidpai is enabled. Disabled if set to 0. If set to 1, then this setting extends anonymous_callerid_by_rpidpai functionality and allows to change empty CallerID.
  • internal_anonymous_callerid_by_rpidpai - Default 0. Works in a similar way to anonymous_callerid_by_rpidpai except that CallerID will stay anonymous when call leaves MOR. All internal operations related to CallerID (for example localization) will be done on a number from RPID/PAI.
  • auth_by_divfromrpidpai - Default 0. If 1, then authentication by CallerID (ANI, pinless dialing) will use CallerID from these headers: Diversion, From, Remote-Party-ID or P-Asserted-Identity. The diversion has the highest priority and P-Asserted-Identity has the lowest priority. First non-empty, non-anonymous CallerID will be used to authenticate the user/calling card. Original CallerID will not be changed. CallerID from these headers will only be used to authenticate the user. Location rules will be applied to this CallerID.

P-Asserted-Identity (PAI)

  • pass_pai - When PAI comes from the Caller should we pass it to Callee automatically? default no (0). If pass_pai = 0 and PAI usage in provider settings = 1, then the core will add PAI header.
  • pass_pai_with_server_ip - Default 0. If 1, then IP address in original PAI header will be replaced with IP address of MOR server. Works only when pass_pai in mor.conf or Pass PAI in device settings is enabled.
  • use_callerid_from_pai - Default 0. If 1, then CallerID from P-Asserted-Identity (PAI) header will be used instead of FROM header CallerID.
  • set_original_source_in_pai - Default 0. If 1, then original source number will be used to construct PAI header (when P-Asserted-Identity usage is enabled in Provider settings). This allows to set "anonymous" source number in SIP FROM field (Provider CallerID) and pass original source number in PAI header.
  • use_pai_if_callerid_anonymous - Default 1. If 1, then MOR will change anonymous CallerID to number from PAI when pass_pai is enabled. If 0, then MOR will pass anonymous CallerID to Provider.

P-Preferred-Identity (PPI)

  • use_callerid_from_ppi - Default 0. If 1, then CallerID from P-Preferred-Identity (PPI) header will be used instead of FROM header CallerID.
  • auth_by_ppi - Default 0. If 1, then ANI/pinless authentication will use CallerID from P-Preferred-Identity. Original CallerID will not be changed. CallerID from this header will be used only to authenticate the user.

CallerID, Privacy

  • use_valid_callerid - Default 0. If 1, then MOR should check if the callerid is valid (contains only numbers). If the option is enabled and callerid is invalid, then MOR will overwrite it with callerid from device settings. If the callerid in device settings is empty or invalid, then the callerid will not be changed. This option can be used to prevent 'anonymous' callerid in cdr.
  • global_cli_auth - Default 1. If 1, then authentication by callerid is global. For example, if reseller's user calls to admin's did, which is assigned to auth by ani dialplan, then this user can be authenticated and vice versa - if admin's user calls to reseller's did, which is assigned to auth by ani dialplan, then this user can be authenticated. This logic also applies when one reseller's user calls to another reseller did. When this option is set to 0, users can be authenticated by callerid only when calling to its owner's DID assigned to 'auth by ani dialplan'.
  • callerid_control_by_best_matching_destination - Default 0. If enabled, changes behavior of 'CallerID Control by Destination' to search for best matching (by prefix) DID instead of nearest DID. If enabled and no matching prefix is found, then the nearest DID will be matched. Algorithm for nearest match described here in Control by Destination section.
  • pass_anonymous_domain - Default 0. If enabled and originator is sending anonymous domain in SIP header From: <xxxxxx@anonymous.invalid>, pass it to terminator.
  • send_privacy_id_for_anonymous_calls - Default 0. If 1, then MOR will add Privacy: id header when originator is sending anonymous callerid.
  • pass_privacy_header - When Privacy comes from the Caller should we pass it to Callee automatically? default no (0)
  • set_diversion_by_callerid - Default 0. If 1, then the SIP Diversion number part will be replaced by a number from the SIP From header. If the originator is not sending the Diversion header, this option has no effect.
  • check_banned_clis - Should MOR check for banned CLIs? Default 1, Enables/Disables ANI/CLI ban system.
  • cid_by_dids_before_localization - Default 0. If 1, then CallerID Control by DIDs (CID from DIDs) is executed before Localization. By default CallerID Control by DIDs (CID from DIDs) is executed after Localization (cid_by_dids_before_localization = 0).
  • copy_legA_name_to_legA_number - Default 0. If enabled, changes Device setting Copy Leg A Name to Leg B Number to apply on Leg A (instead of Leg B). This way localizations, blacklisting, and other functions will use a new CallerID Number (CallerID Name, which is copied to Number). Works only if Device has enabled setting Copy Leg A Name to Leg B Number.
  • allow_empty_cid_name - (only on Asterisk 15) Default 1. If enabled (set to 1), Asterisk allows to send empty CID name to providers (for example, From: <sip:370000@host>). If disabled (set to 0), Asterisk will not allow to send empty CID name. In that case, Asterisk sets CID name as CID number (for example, From: "370000" <sip:370000@host>). This option mimics Asterisk 1.8 behavior where is not allowed to send empty CID name.
  • clean_callerid - Default 0. If enabled (set to 1), then incoming CallerID will be cleaned (everything from ; symbol will be cut). For example, if incoming CallerID is <sip:3700000;tag=yyyyy@host>, then after cleaning it, only the number part "3700000" (;tag=yyyyy will be cut) will be used.

MNP

  • mnp_enabled - Default 0. If enabled (set to 1), then MNP check will be performed on each call.



In order to activate changes made to this file, you need to restart Asterisk or reload MOR Core


Reload MOR Core

  1. Login to Asterisk CLI
  2. Issue: mor reload