Making Calls Through a Specific Provider
Last updated
Last updated
In MikoPBX (Telephony → Employees), the following employee accounts are configured:
In MikoPBX, there are two providers configured (Routing → Telephony Providers):
The requirement is that:
The phone connected to account 201 should only make calls through the first provider PT.
The phone connected to account 202 should only make calls through the second provider Zadarma(Novofon).
Outbound calls to the external world (to a city) through both providers are implemented using the same outgoing rule: it's a ten-digit number starting with 7. This task can be schematically represented as follows:
Routing calls through a specific provider can be achieved using outbound dial plan prefixes.
Calls will always go through the first provider if you add 1 before the outgoing number. Therefore, if the subscriber with 201 wants to dial outgoing numbers with the 1 prefix, the calls will go through the first provider.
Calls will always go through the second provider if you add 2 before the outgoing number. Therefore, if the subscriber with 202 wants to dial outgoing numbers with the 2 prefix, the calls will go through the second provider.
You can schematically represent this as follows:
You can implement this task in two ways in MikoPBX:
Subscribers 201 and 202 will always add specific prefixes before dialing on their phones. For example, if they want to call the number 74952293042, they will add the prefix 1 or 2 before this number, such as 174952293042 or 274952293042.
Subscribers 201 and 202 do not dial special prefixes; the PBX itself performs this action for them.
The first method of implementing our task assumes that subscribers 201 and 202 will independently dial the corresponding prefixes on their phones. Subscriber 201 will always add 1 before the number, and subscriber 202 will add 2.
For the first provider, create an outbound rule. Go to Routing → Outbound Routes. Add a new rule.
Fill in the parameters as shown in the screenshot below:
3. For the second Zadarma provider, we create an outgoing rule. Go to the Routing → Outgoing routes section. Adding a new rule as in the screenshot below:
The second method of implementing our task assumes that subscribers 201 and 202 do not dial specific prefixes on their phones; the PBX does this for them.
Add outbound rules for the first and second Zadarma providers, as described in the first method. The settings are identical.
In the Routing → Telephony Providers section, add a third provider account.
Fill in the parameters as shown in the screenshots below:
Save the account and copy the ID of this provider in the address bar.
Add an outgoing rule for the created provider. By default, we will direct all calls through this provider, so be careful when creating an outgoing template. Calls through our providers can be made to numbers starting with 7, so our template takes the form:
Please note that the priority of the outgoing rule for the Router provider should be lower than all!
Go to System -> System file customization section
Open the extensions.conf configuration file for editing.
Select the "Add to end of file" mode. In the editing window, insert the following lines:
In the code snippet above, you need to create the correct context name. The format of the created context:
PROVIDER-ID - the value you saved in the third step described in this method. In our example, it's SIP-1690973516.
Save the changes and return to the list of configuration files.
This way, for the 201 and 202 accounts, we have set prefixes. All outgoing calls will now go through the required provider.
In some cases, when defining incoming routes, you may need to redirect a call not to an internal number but to an employee's mobile number. In this case, you need to describe the "Default Prefix," otherwise, there may be problems with handling such calls.
When routing by DID number:
For each provider, you should also describe the context:
With these configurations, you have completed the setup.