Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
When describing outgoing routes, it is allowed to use the same phone number template.
If several routes are used with the same template, the PBX will try to make a call on each of the routes until the call is accepted.
This functionality is not always necessary and there may be a need to disable it.
At the moment, this can only be done through the customization of the PBX.
Go to the provider's settings and copy its ID in the browser's address bar:
Go to the section "System file customization"
Go to the editing section of the extensions.conf file.
Add the following context to the end of the file:
Save the changes. Now all calls via routes associated with the provider will occur without taking into account the backup provider. It will work out only the first of the outgoing routes.
It is necessary to be able to call emergency numbers 112, 1xx
Go to the Routing → Outbound routes section.
Adding a new rule
Fill in the parameters as in the screenshot below:
You direct calls to emergency numbers through an arbitrary provider. The provider must support dialing emergency numbers. The priority of this rule should be the highest, i.e. it should be described first in the list of created outgoing routes.
Go to System → System file customization
Open the extensions.conf configuration file for editing.
Set the "Add to end of file" mode. In the black window, add the following code snippet:
In the above code snippet, we described the rules for all three-digit numbers starting with 1. If you need to specify specific emergency numbers, then instead of the above code, you need to insert the following lines:
Calls to numbers:
383 XXXXXXXXXX
380 XXXXXXXXXX
375 XXXXXXXXXX
371 XXXXXXXXXX
Go to Routing → Outbound Routing
Create a new outbound routing rule:
Fill in the parameters according to the template below:
Now, when calling any numbers that meet the patterns: 383 XXXXXXXXX, 380 XXXXXXXXX, 375 XXXXXXXXX, 371 XXXXXXXXX, the call will be routed through the provider (Novofon).
Go to the System file customization section
Open modules.conf for editing
Add the following code to the end of the file:
Open the extensions.conf file for editing
Add the following code to the end of the file:
In the lines of the form "Set(PUSH(rrItem)=SIP-1601534775)", the ids of providers are listed, among which outgoing ones should be evenly distributed. The ID can be copied in the browser's address bar when editing the provider. The "busyLevel" variable defines the maximum allowed number of simultaneous calls through the provider.
For each provider, you will need to describe the outgoing route. The template in the routes must be the same.
Let's say there is a certain number +371 (2) 637‑23‑33, by calling to which and dialing an extension you can get to a specific employee. This can be extremely convenient, especially if the extension number is longer than 3 characters. Next, we describe an example of the implementation of the task.
To solve the problem, additional contexts should be described through the Customization of System Files menu.
We will edit the extensions.conf file.
Add the following text to the end of the file:
Next, it is necessary to describe the Applications of dialplans
Select "Type of code" - "Asterisk Dialplan"
Let's say you need to "dial" the number 3542331, set this value to "Number to call the application"
Go to the "Programme Code" tab and insert the template:
If you specify the 9XXXX template in the "Application call number" field, it will be possible to "dial" any five-digit numbers starting with the digit "9"
In the application, assign the variable "ZDST" the number to which the call should be made In the "ZDTMF" variable, specify the number for the additional set
In the "ZPROVIDERID" variable, specify the ID of the provider through which the outgoing call should be made. ID can be peeped in the browser address bar when editing the provider
The task is to remove the area codes 6017, 6095, 6096, or 6099 and retain the 7-digit number. For example, numbers 60172293042 and 60956382584 should be transformed to 2293042 and 6382584, respectively.
Navigate to the "Routing" → "Outbound Routes" section.
Click "Add New Rule."
Create the pattern as shown in the image:
Click "Save."
The task is to add the prefix "1" to a number. For example, numbers 4952293042 and 4996382584 should be transformed into 14952293042 and 14996382584, respectively.
Navigate to the "Routing" → "Outbound Routes" section.
Click "Add New Rule."
Create the pattern as shown in the image:
Click "Save."
It is necessary to replace the number prefixes +345 with 347. For example, the number +3454952293042 should be converted to the number 3474952293042.
Go to "Routing" → "Outbound Routing"
Click "Add a new rule"
Create a template as shown in the image:
Click "Save settings"
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.
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.
It is necessary to replace the number prefixes 345, 347 with +345. Example, the numbers 3454952293042 and 3474952293042 should be converted to +3454952293042.
Go to "Routing" → "Outbound Routing"
Click "Add a new rule"
Create a template as shown in the image:
Click "Save settings"
Go to the “System” section -> “System file customization”
Select the file “/etc/asterisk/extensions.conf” to edit.
Select the “Add to end of file” mode.
Add the code to the second field:
Save settings.
Some softphones / CTI solutions transmit a phone number with special characters when dialing, for example +371(2) 229-3042
Such a call is very likely to fail, it will be completed by mistake.
To solve the problem of "filtering" characters, an additional context should be described through the menu
We will edit the extensions.conf file.
Add the following context to the end of the file:
According to the described rule, only the characters *#1234567890 will remain in the dialed number
Some providers require sending an additional SIP header when initiating an outgoing call. In this article we will describe a way to install it.
To solve the problem, additional contexts should be described through the System File Customization menu.
We will edit the extensions.conf file.
Add the following text to the end of the file:
Pay attention:
All occurrences of the line "SIP-1611151795" should be replaced with the provider ID "you can find" in the browser address bar when editing an account in the MIKOPBX web interface
The peculiarity of this option is that the value "OUTGOING_CID" will be taken from the settings of user groups. For each group, you can assign your own value of the outgoing caller id. For example, the Westcall provider thus allows you to control the value of the callerid that the client sees.
Let's say a conference room with the number "354233" is configured on the PBX.
When calling an employee(s) to a conference, it is always necessary to connect an external subscriber.
When disconnecting employees from the conference, the external subscriber must be disconnected
This may be required to organize communication with an external (relative to MIKOPBX) conference. It will allow saving on outgoing calls (only one line will be occupied).
In the "Telephony" section, go to "Conference" and create a new conference.
We will indicate the name of the room "Z-CONF-354233"
We will indicate the internal number "354233"
Name "Z-Worker-CONF"
The number to call "2200103" (can be arbitrary)
Specify the code type "PHP-AGI script"
Programme code:
Adding the task to the end of the file:
In this example, "DIALPLAN-APP-EC12CFAE6783FE82FD34F16E40C7386B" is the ID of the previously created application. The ID can be peeped in the browser address bar when editing the application.
Add the following code to the end of the file:
When calling the conference number 354233, an external subscriber with the number 37127776675 will automatically connect. As soon as the subscriber answers, the extension number 354233 will be dialed. As soon as all the "internal" participants have left the conference, the external subscriber will be disconnected.
The task in the crown is needed only for additional "protection", in fact it is a restart of the php script every minute
Add outbound rules for the first and second Zadarma providers, as described in the . The settings are identical.
Now it's done
Instead of "", the required header value should be set
Let's describe the "Dialplan Application" (see )
Edit the file "/var/spool/cron/crontabs/root" via the menu
We will describe additional contexts through the menu. We will edit the extensions.conf file.