Difference between revisions of "Mor.conf"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 69: Line 69:
* '''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.
* '''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.
* '''set_diversion_by_callerid''' - Default 0. If 1, then SIP Diversion number part will be replaced by number from SIP From header. If originator is not sending Diversion header, this option has no effect.
* '''set_diversion_by_callerid''' - Default 0. If 1, then SIP Diversion number part will be replaced by number from SIP From header. If originator is not sending Diversion header, this option has no effect.
* '''pass_anonymous_domain''' - Default 0. If enabled and if originator is sending anonymous domain in SIP header From: <xxxxxx@'''anonymous.invalid'''>, pass it to terminator.
<br><br>
<br><br>
In order to activate changes made to this file, you need to restart Asterisk or reload MOR Core
In order to activate changes made to this file, you need to restart Asterisk or reload MOR Core

Revision as of 18:51, 10 February 2020

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.


  • hostname, dbname, user, password, port, sock – All these values describe connections to the database.
  • 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.
  • 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).
  • check_banned_clis - Should MOR check for banned CLIs? Default 1, Enables/Disables ANI/CLI ban system (available from MOR 8).
  • use_flat_rates - Should MOR use Flat-Rates, default 1.
  • use_speed_dials - Should Speed Dials be enabled.
  • server_ip - external server IP, default 127.0.0.1 (Used in P-Asserted-Identity).
  • play_hgc_audio - Should we play audio with error message when 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 into MOR) (This option is available starting from MOR 10.)
  • play_hgc_x - if you want to play audio with error message on specific hangup cause, replace x in play_hgc_x with specific code. 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 global play_hgc_audio setting. For example play_hgc_220 = 0 will disable audio error message for 220 User call limit reached. Audio files should be located in /var/lib/asterisk/sounds/mor/hgc/. Default files can be downloaded from www.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).
  • 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
  • pass_pai - When PAI comes from Caller should we pass it to Callee automatically? default no (0). If pass_pai = 0 and PAI usage in provider settings = 1, then 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.
  • pass_rpid - When Remote-Party-ID comes from Caller should we pass it to Callee automatically? default no (0)
  • pass_privacy_header - When Privacy comes from 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.
  • 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)
  • 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)
  • 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.
  • 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 P-Asserted-Identity (PAI) header will be used instead of FROM header CallerID.
  • use_callerid_from_ppi - Default 0. If 1, then CallerID from P-Preferred-Identity (PPI) 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.
    • 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. 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. 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.
  • cdr_batch_size - Starting from MOR X6 (and optionally in MOR X5), this variable defines how may calls should be buffered, before inserting them to database. Buffered calls are inserted to dabase in one batch. This feature reduces SQL request and load on database. Default value is 30 calls. If 0, then this feature is disabled.
  • cdr_flush_time - Starting from MOR X6 (and optionally in MOR X5), this variable defines how often to flush calls from buffer to database (see cdr_batch_size). Default value is 5 seconds. Every 5 seconds buffer is flushed to database, even if buffer is not full.
  • billsec_round_function - how billsec should be rounded? Allowed values are ceil, round and floor. Ceil will round to 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.
  • 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
  • disable_calls_when_balance_empty - Default 0. If 1, then MOR will not allow Users to make calls even if price for 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 number contains special character (default p) followed by a number. For example 12345p370123. If number matches this format, MOR will dial first number (before letter p) and then instead on asking user to enter destination number MOR will dial second number (after letter p). First number is usually access number and second number is destination number. This feature allows to skip "Please enter destination number" prompt and dials directly to specified number.
  • pause_code - set special character for use_pause_code setting. Default is p.
  • mysql_ping - Default 0 (disabled). If value is greater than 0, then MOR Core will periodically ping MySQL server to keep connections alive. Value (in seconds) defines how often to ping MySQL server.
  • reroute_stop_hgc - List of hangup cause codes (ISDN codes, not SIP) that should stop rerouting through other providers. If provider returns code that is specified in reroute_stop_hgc setting, core will skip other providers in LCR. Multiple causes can be specified by separating them with comma separator, for example reroute_stop_hgc = 1,2,3
  • remove_mor_headers - Default 0 (disabled). If 1, then MOR will not send custom MOR headers (x-MOR-XXXXXX) to 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 to call when provider's connection fee is higher than user's connection fee. This logic also applies to reseller and rartners, for example if reseller's connection fee is higher than partner's, MOR will not allow to call since parter will have loss call.
  • disable_cc_empty_ivr - Default 0. If 1, then CC Empty IVR will be disabled. CC Empty IVR is executed when client enters PIN of empty Card. This IVR allows to TopUp Card. If you want to disable TopUp for empty Cards, set disable_cc_empty_ivr to 1.
  • 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).
  • do_not_log_failed_ad_cdrs - Default 0. If 1, then MOR will not save failed autodialer CDRs to database.
  • 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 comma separator. Header names are case sensitive.
  • 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 user.
  • 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).
  • 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.
  • set_diversion_by_callerid - Default 0. If 1, then SIP Diversion number part will be replaced by number from SIP From header. If originator is not sending Diversion header, this option has no effect.
  • pass_anonymous_domain - Default 0. If enabled and if originator is sending anonymous domain in SIP header From: <xxxxxx@anonymous.invalid>, pass it to terminator.



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