MOR Prelocalization
Prelocalization allows to do additional Localization before any other action in MOR. Prelocalization is applied to incoming calls (calls to DID numbers) too.
Purpose
Prelocalization allows for greatly reducing the number of Localization rules.
MNP routing and EU/Non-EU discrimination require many rules to work.
When calls come in from clients that can have one of the following formats (Greek example):
- 210XXXXXXX (national format)
- 30210XXXXXXX(E.164 format)
- +30210XXXXXXX (International format)
- 0030210XXXXXXX (international format)
If prelocalization does not exist, then each rule applied to localization must be repeated for every dialing type, thus increasing the overall number of rules.
This is why prelocalization is needed: we avoid adding the same rule multiple times to cover all client dialing types.
Example: In an MNP environment, prefixes are added to the destination numbers. These prefixes have to be removed using localization rules.
If the prefix added is 569000, then we will need 4 rules in order to solve this, although with prelocalization, we would only need one rule
Without prelocalization rule:
If prelocalization rules exist, then before MNP prefix is added, or before localization is hit, number would already be localized e.g. 302XXXXXXXXX so we would only need 1 rule instead 4 for one prefix.
Prelocalization greatly reduces the number of rules needed, so if it exist we would only need the following rule for the same case:
Configuration
Configuration file /etc/mor/system.conf
prelocalization_location - Which location to use for prelocalization? Value should be Location ID.
prelocalization_global_rules - Should we include global rules? Value is either 1 or 0 (default 0).
For example:
prelocalization_location_id = 17 prelocalization_global_rules = 1
Asterisk reload is required:
asterisk -rx "more reload"
Location rules
Prelocalization supports only Destination and Source rules. Combined rules are not supported.
Only Cut, Add, Min Len and Max Len are applied when doing prelocalization.
Script output (X17 and older)
Prelocalization output is written to the Asterisk verbose log at the beginning of the call:
mor_prelocalization: MOR prelocalization AGI script started mor_prelocalization: Original destination number: 00370123456 mor_prelocalization: Original source number: +390000000 mor_prelocalization: Original source name: test mor_prelocalization: Localized dst number: 370123456 (cut: 00, add: ) mor_prelocalization: Localized src number: 390000000 (cut: +, add: ) mor_prelocalization: MOR prelocalization AGI script stopped
