h1. Call routing {{>toc}} *Routing* - the process of building a routing table in response to the parameters of an incoming call according to the current static settings of the system, as well as dynamic parameters such as [[Balances]] and [[Metrics of telephone traffic]]. * Routing table * is a sorted list of peers and parameters to call for each route. The system performs [[Hunting]] on the found and sorted routes. Routing is done by the following applications: * [[Softswitch]] * [[Calling Cards]] Therefore, in order to use the Smartswitch routing system, you need to use one of these applications in the [[Call handler|Call handler]]. Otherwise, if the outgoing call is made by the [[Dial]] application directly, the call does not go through the built-in routing system of Smartswitch. To check the routing table, you can use the [[Check Routing]] tool located on the edit page of each peer. h2. Configuring the routing table Supported *routing table configuration modes*: * *According to the list of routes*. Within a [[Route classes (Telephony)|Route class]] you must configure a list of [[Routes (Telephony)|Routes]] that will be active for all traffic profiles. And inside each route, you can specify the [[Route rules (Telephony)|Traffic matching rules]] to override the settings for a specific traffic profile. * *By traffic profile*. First, you must configure [[Route class rules (Telephony)|Traffic matching rules]] to define specific traffic profiles. Then, within each Rule, you must configure the [[Route class rule routes (Telephony)|Routes]] list for this traffic profile. The choice of a specific configuration mode depends on your preferences and business specifics. You can use both modes at the same time. In this case, if the system does not find any route in one of the modes, it tries to find routes according to the other mode. If routes are found in one of the modes, the search for routes in the other mode is not performed. You can configure the priority of using the modes. You can also use the *base route class* option to inherit from another [[Route Classes (Telephony)|Route Class]]. In this case, if the system does not find any routes in the current route class, it starts searching in the base route class. Inheritance can be done recursively. h2. Routing modes. The system supports the following routing modes: * *Routing by current static system configuration*. * [[Routing based on telephone traffic metrics]]. * [[Routing based on telephone traffic target metrics]]. * [[Percentage routing]]. * *Mixed routing*. A combination of the above modes is used at the same time. All modes take into account: * [[Route classes (Telephony)|Route class]] and its contents configured on the originator * the [[Number replacement]] parameters on all involved peers * a [[Tariff plan]] configured on all involved peers. The resulting routing table will not include routes for which cost cannot be determined unambiguously. * [[Profit control]]. The resulting routing table will not include routes that do not pass the [[Profit control]]. * technologies configured on all involved peers. The technology for the outgoing call will be selected in such a way as to avoid converting [[Message technologies]], if possible. * [[Balances]] of all involved peers. The routing table will not include peers, calls to which are blocked by balance. * blocked routes by the [[Controllers|Controllers]]. * etc h2. Procedure for creating a routing table by the system The routing table is created in the following order: # Defines all possible peers for call routing according to the current settings, [[Balances|Balances]], etc. # The [[Routing table sorting]] occurs according to the configured [[Metrics (Telephony)|Metrics]]. # The system excludes some routes according to: * _traffic portion_ to perform [[Percentage routing]]. * parameter +huntstop+. If the +always+ option is enabled in the [[Huntstop profiles (Telephony)|Huntstop profile]] of a route, the system deletes all routes from the routing table that have been placed in the routing table after the given route. See also: * [[Routing table sorting]] [[Маршрутизация звонков|Русский перевод]]