.. _routing_plan: Routing Plans ~~~~~~~~~~~~~ Routing Plans are used for describing common parameters that can be applied for set of :ref:`Dialpeers ` that are specified by :ref:`Routing Groups `. **Routing Plan**'s attributes: `````````````````````````````` .. _routing_plan_id: Id Unique Routing Plan's id. Name Unique Routing Plan name. .. _routing_plan_sorting: Sorting This field is used for setting sorting method for the routes (Dialpeers) within *Routing Plan*. Regardless from the sorting method all :ref:`Dialpeers ` within *Routing Plan* will be filtered by using following rules: - :ref:`Prefix ` of :ref:`Dialpeer ` record is in the prefix range of **URI name** (destination) that was processed by Number translations procedures (if any); .. note:: Examples: - Prefix of :ref:`Dialpeer ` record = ** ; **URI name** = *0662296132* => **TRUE** - Prefix of :ref:`Dialpeer ` record = *066* ; **URI name** = *0662296132* => **TRUE** - Prefix of :ref:`Dialpeer ` record = *066[1-3]* ; **URI name** = *0662296132* => **TRUE** - Prefix of :ref:`Dialpeer ` record = *066[1-3]* ; **URI name** = *0665296132* => **FALSE** - Length of **URI name** (destination) that was processed by Number translations procedures (if any) is between :ref:`Dst number min and max length ` values of :ref:`Dialpeer ` record; .. note:: Examples: - Dst number min length of :ref:`Dialpeer ` record = *3* ; Dst number max length of :ref:`Dialpeer ` record = *15* ; **URI name** = *380662296132* => **TRUE** - Dst number min length of :ref:`Dialpeer ` record = *7* ; Dst number max length of :ref:`Dialpeer ` record = *7* ; **URI name** = *7050460* => **TRUE** - Dst number min length of :ref:`Dialpeer ` record = *0* ; Dst number max length of :ref:`Dialpeer ` record = *7* ; **URI name** = *0487050460* => **FALSE** - :ref:`Dialpeer ` record is still :ref:`valid `; - :ref:`Balance ` of :ref:`Vendor's Account ` (that was chosen for the :ref:`Dialpeer `) is less than :ref:`Max balance ` value of this Account; - :ref:`Contractor ` that :ref:`was chosen ` for the :ref:`Dialpeer ` is enabled and has type: **Vendor**; - :ref:`Routing tags ` that were chosen for the call at the previous steps (Authentication, Numberlist processing etc.) and :ref:`Routing tags ` that were chosen in the field :ref:`Routing tag ids ` of :ref:`Dialpeer ` are matched to each other. Principles of the :ref:`Routing tags ` matching are described in this :ref:`Example (Truth table for tags) `. The following algorithms (sorting methods) are available: **LCR, No ACD&ASR control** - Sorting only on the basis of least-cost routing (LCR) algorithm (routes with lowest price will be on the top of rating) without control of :ref:`Acd Limit ` and :ref:`Asr Limit ` parameters of :ref:`Dialpeer `. **Prio,LCR, ACD&ASR control** - Sorting on the basis of internal :ref:`Priority ` of :ref:`Dialpeers ` with following sorting on the basis of least-cost routing (LCR) algorithm (routes with highest priorities will be on the top of rating, in case of same priorities LCR sorting will be used) with control of :ref:`Acd Limit ` and :ref:`Asr Limit ` parameters of :ref:`Dialpeer ` (routes where values of these parameters are less than presetuped limits couldn't be chosen for routing). **LCR,Prio, ACD&ASR control** - Sorting on the basis of least-cost routing (LCR) algorithm with following sorting on the basis of internal :ref:`Priority ` of :ref:`Dialpeers ` (routes with lowest price will be on the top of rating, in case of same prices sorting on priorities will be used) with control of :ref:`Acd Limit ` and :ref:`Asr Limit ` parameters of :ref:`Dialpeer ` (routes where values of these parameters are less than presetuped limits couldn't be chosen for routing). **LCRD, Prio, ACD&ASR control** - Sorting on the basis of modified least-cost routing (LCR) algorithm with following sorting on the basis of internal :ref:`Priority ` of :ref:`Dialpeers ` (routes with lowest price will be on the top of rating, in case of same prices sorting on priorities will be used) with control of :ref:`Acd Limit ` and :ref:`Asr Limit ` parameters of :ref:`Dialpeer ` (routes where values of these parameters are less than presetuped limits couldn't be chosen for routing). Difference of this algorithm from the classic LCR algorithm is on the using :ref:`Rate Delta Max ` value during the sorting of :ref:`Dialpeers ` by price. :ref:`Dialpeers ` with prices that are different one from other less than :ref:`Rate Delta Max ` value will be on one level of sorting by price and :ref:`Priority ` will be used for building routing rating between them. **Route testing** - This mode of sorting usually used for testing routes from different Vendors. In this mode you can use especial format of destination number: XX*YYYYYYYYYY, where XX - :ref:`Vendor ID ` and YYYYYYYYYY - phone number. In this mode most preffered :ref:`Dialpeer ` of :ref:`Vendor ` with XX ID will be used for the routing. **QD-Static, LCR, ACD&ASR control** - Sorting on the basis of modified internal :ref:`Priority ` of :ref:`Dialpeers ` with following sorting on the basis of least-cost routing (LCR) algorithm (routes with highest priorities will be on the top of rating, in case of same priorities LCR sorting will be used) with control of :ref:`Acd Limit ` and :ref:`Asr Limit ` parameters of :ref:`Dialpeer ` (routes where values of these parameters are less than presetuped limits couldn't be chosen for routing). In this method of sorting :ref:`Priority ` of :ref:`Dialpeers ` will be re-writen by :ref:`Priority ` of the :ref:`Routing plan static route ` (if this static route is present in this *Routing plan*). **Static only, No ACD&ASR control** - Sorting only on the basis of :ref:`Priority ` of the :ref:`Routing plan static route ` (if this static route is present in this *Routing plan*) without control of :ref:`Acd Limit ` and :ref:`Asr Limit ` parameters of :ref:`Dialpeer `. Routes with highest priorities will be on the top of rating. Routing will be done only in case of presence of :ref:`Routing plan static route ` record and :ref:`Dialpeer ` record that are related to this *Routing plan*. .. _routing_plan_use_lnp: Use Lnp If this flag is enabled to all calls with ported numbers that are associated with this *Routing plan* via :ref:`Customer Auth ` record, will be applied local number portability procedure (receiving information from :ref:`LNP Cache ` or sending request to :ref:`LNP Database `. .. _rate_delta_max: Rate Delta Max This value is used for *LCRD, Prio, ACD&ASR control* method of sorting. You should setup this value in case of using this method of sorting. :ref:`Dialpeers ` with prices that are different one from other less than :ref:`Rate Delta Max ` value will be on one level of sorting by price and :ref:`Priority ` will be used for building routing rating between them. Routing Groups :ref:`Routing Groups ` that are related to this *Routing Plan*. The rules that are described in this *Routing plan* will be applied to all :ref:`Dialpeers ` that are associated with chosen :ref:`Routing Groups `.