Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
MikoPBX can determine the phone number to which the call came from the client. For example, company employees, when receiving an incoming call from a client, need to understand which number the client called. This information should be displayed when a call is received from a client and displayed on the phone. The number the customer called is called the did number. Further in the instructions, we will consider how to display information about the did number on the screen of your phone.
Go to Call Routing → Telephony Providers. Open the provider's account for editing. Copy in the address bar the ID of the provider through which subscribers call you to the company. Please note that in our example, a single provider is used. If you have configured the connection of several providers, then the following steps must be performed for each provider.
In our example, the provider ID takes the form: SIP-1687941868
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, you need to make the correct context name.
Format of the created context:
PROVIDER-ID is the value that you saved in the first step of this instruction. In our example, this is SIP-1687941868.
In addition to the did number, you can output the name of the provider / line through which the call passed. To do this, follow these steps:
Go to Call Routing → Telephony Providers. Open the provider's account for editing. In the Advanced Options field, specify a variable with the name of the provider.
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, you need to make the correct context name.
Format of the created context:
PROVIDER-ID is the value that you saved in the first step of this instruction. In our example, this is SIP-1687941868.
In MikoPBX, in the Call Routing → Night and Holiday section, rules for routing calls outside working hours are configured. These rules apply to all calls, regardless of which company number the client called. It is necessary to set individual non-working hours for the Zadarma provider. Working hours for this provider: from 9.00 to 18.00 Moscow time.
Go to Modules → Dialplan Applications. Create a new application (Asterisk dialplan) following the instructions. Application parameters take the form:
The program code of the created application:
The ExecIfTime command executes the specified Asterisk application if the current time matches the specified time specification. If we receive a call from 9:00 to 18:00 on any weekday (Monday to Friday), we redirect the call (Goto command) to 2003. 2003 is the IVR menu number.
Otherwise, the call will be routed to the employee with extension 201.
Set up inbound routing rules for the created provider. Go to the Routing → Incoming routing section. We direct all incoming calls to the created application
Find and copy the provider ID. To do this, go to the configuration of the required provider. In our example, this is SIP-1687941868
Go to System -> System file customization
Open the configuration file extensions.conf for editing.
Set the "Add to end of file" mode. In the black window, add the following code snippet:
In the above code snippet, you need to make the correct context name.
Format of the created context:
PROVIDER-ID is the value that you saved in the second step of this instruction. In our example, this is SIP-1687941868.
Working hours are from 9.00 to 18.00, therefore it is necessary to set two intervals for non-working hours: 00:00-09:00 and 18:00-23:59.
Let's analyze the ExecIfTime command in more detail. This command executes the specified Asterisk application if the current time matches the specified time specification. In our case, the command plays a sound file located in the /offload/asterisk/sounds/other/out_work_times directory in MikoPBX.
Command syntax:
times - Time ranges in 24-hour format
weekdays - Days of the week (mon, tue, wed, thu, fri, sat, sun)
mdays - Days of the month (1-31)
months - Months (Jan, Feb, Mar, apr, etc.)
appname[(appargs)] - Asterisk command specifying the call parameters
In our example, the time range, the range of days of the week are indicated. Instead of specifying days months and months, * are entered. This symbol means "for all other cases".
Go to the System file customization section
Proceed to editing the "modules.conf" file
Add the following code to the end of the file:
Go to editing the file "extensions.conf"
Add the following code to the end of the file:
In the extension card, in the "Advanced Settings" - "Extra Options" field, set the value
If the employee is busy, a beep file (a short beep) will be played to the caller, then music will be played instead of beeps until the employee answers the call
device_state_busy_at is the number of conversations at which the employee should be considered "busy", in this case the "Routing Settings" rules described in the employee card will start working.
If the problem solution does not work correctly, change the code in extensions.conf to:
Task: Several providers A,B, C, D are installed on the PBX… The call arrives at MikoPBX through provider A. When dialing an employee's mobile number, the call must also go through provider A. The provider must support more than one simultaneous call.
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:
For each provider, it is necessary to describe the outbound routes
Fill in the mobile numbers for employees (see the documentation)
Limit the use of outgoing routes for users, use the "User Groups" module
Now, if an incoming call is sent to an employee's mobile phone, for example through the IVR menu, then the call will be sent through the same provider through which it came
Go to System → System file custmization.
Open the extensions.conf configuration file for editing.
Set the "Add to end of file" mode and paste the following code:
The whitelist of numbers sometimes needs to be described for specific providers:
PROVIDER-ID - the value that you can find in the address bar at the time of provider configuration
When configuring inbound routing, a common scenario arises when a provider offers a single SIP account for multiple purchased phone numbers.
For example, at MIKO, there are phone numbers:
+7(495)229-30-42
+7(499)638-25-84
In the MikoPBX interface, only one "Telephony Provider" account is created. Each phone number needs to be directed to its own route, such as different IVRs.
This is where the comes to the rescue, which the provider can transmit during inbound calls. Knowing the DID number, you can define multiple inbound routes for the provider, each with a different DID, which solves the described problem.
For call analysis, I usually use the "". Here's an example request from the provider for an incoming call:
When receiving such a packet, MikoPBX analyzes the first line with the keyword "INVITE," extracts the value "84996382584," and considers it as the DID number.
In practice, it's not always so straightforward. For example, I've encountered a provider that sends the following INVITE:
The "PJSIP_HEADER" function reads the value of the "To" header.
The "PJSIP_PARSE_URI" function retrieves the "user" field from the header, which corresponds to the DID value.
Gosub moves the channel to the beginning for reinitializing the route.
SIP-1622040384 is the ID of the MikoPBX provider account, which can be found in the browser's address bar when editing the account.
This occurs when using the roistat service. The service may send the following request for incoming calls:
In this case, there is no correct DID in either the INVITE or the To field, but a new header "x-roistat-phone" has appeared.
The "PJSIP_HEADER" function reads the value of the "x-roistat-phone" header.
Gosub moves the channel to the beginning for reinitializing the route.
Mango Office
Obtaining the number that the customer called from the "Diversion" field:
Novafon (Zadarma)
Obtaining the number that the customer called from the "CALLED_DID" header:
A customer calls the company, and a welcome message (greeting) is played.
While the greeting is playing, the customer can dial any internal extension number, for example, an employee's extension number.
Additionally, the customer can press:
1 - the call will be routed to the employee with extension number 201.
2 - the call will be routed to the employee with extension number 202.
If the customer doesn't press anything or enters an incorrect number, the call will be redirected to the default number - the employee with extension number 201.
The task can be visually represented as follows:
When a call is made to the IVR menu (IVR menu number), the sound file "Greeting" will start playing.
While the greeting is playing, the customer can:
Dial any internal extension, for example, an employee's extension. This is enabled by the Allow dialing of any extension option.
Press 1 to route the call to the employee with extension number 203.
Press 2 to route the call to the employee with extension number 201.
If the customer does not enter anything during the greeting, after the greeting plays, the system waits 7 seconds for a digit input. "Total time for number entry" = "Greeting duration" + 7 seconds.
If the "Total time for number entry" expires, the call is redirected to the "Default number," which is the employee with extension number 101.
To repeat the greeting and allow the customer to enter a number again, set the "Number of retries before redirecting to the default number" to 2 or more. The greeting will be repeated, followed by another 7-second wait, allowing the customer to retry the IVR. Once the retries exceed the set value, the call is redirected to the "Default number."
If the customer enters an incorrect number or does not enter anything, the greeting will repeat (if the Number of retries is set to more than 2), or the call will be redirected to the "Default number" (if the Number of retries is set to 1).
Set up incoming calls to be routed to the IVR menu via the configured provider.
When connecting multiple providers to MikoPBX, you may encounter situations where customer phone numbers come in different formats:
In 7-digit format - 2293042
With a "+" sign, for example, +79257184444
With "8", for example, 89257184444
There is a need to standardize all these formats.
Go to the Routing → Telephony Providers section. Open the provider's account for editing. Copy the Provider ID from the address bar, through which subscribers call your company. Please note that in our example, we are using a single provider. If you have multiple providers configured, you need to perform the following steps for each provider.
In our example, the Provider ID looks like: SIP-1687941868
Go to the System → System file customization section.
Open the configuration file extensions.conf for editing.
Add the folowwing code in the end of file:
In the code above, you need to create the context with the correct name. Format for creating the context:
ID-PROVIDER - the value you saved in the first step of this instruction. In our example, it's SIP-1687947415.
Please note that if you have multiple providers in MikoPBX, you need to create the code fragment above for each provider, taking into account the uniqueness of each provider's ID.
If you want to add normalization for all providers at once, you can create the "add-trim-prefix-clid-custom" context. For example, to add a "7" to all 10-digit caller IDs:
Such a need may arise in many cases, For example, when a client is tired of waiting on the line, you can offer him to leave a voice message, connect with an internal number known to the client.
Go to System → System file custmization.
Open the file "queues.conf" for editing
In the black window, find the queue section that you need to configure
Select the "Add to End of File" mode. Add a similar section with the prefix (+) :
In this example, we have described the internal context, the dialing of all internal numbers is allowed. You can specify the context of the IVR menu, in the format ivr<InternalNumberIVR>
In this case, the account login is described in the "INVITE" line, while the DID is described in the "To" header. To set it up correctly, you just need to add the following lines to the section at the end of the "extensions.conf" file:
To set it up correctly, you just need to add the following lines to the section at the end of the "extensions.conf" file:
Create employee accounts by following the . Connect softphones or hardware phones to these accounts.
Add the greeting sound file by following the . This file will be played when the customer calls the company's phone number.
Create a new IVR menu by following the .
Add a providers account through which calls will be made, following the . Examples of provider connections can be found .
Instructions for configuring incoming call routing are available .
The client calls the company, a welcome message (voice greeting) sounds.
During the playback of the voice greeting, the client can dial any internal number, for example, the extension number of an employee or the extension number of a department.
After playing the voice greeting, the client can enter numbers from the phone:
1 - in this case, the call will be sent to the sales department. The sales department is a call queue consisting of two queue agents (two employees). When calling the sales department, the call must be received on the phones of employees at the same time. If none of the employees answered the customer's call within 25 seconds, the call should be sent to the employees' mobile numbers.
2 - the call will be sent to the technical support department. The Technical Support Department is a call queue consisting of three queue agents (three employees). The call must be received by any available employee (queue agent). If the client waits more than 30 seconds for his call to be answered, the call must be transferred to the secretary. If the client has not entered anything / incorrectly dialed the number, then a repeated voice notification occurs and the client can enter the number again. As soon as all attempts to enter the correct number for the client are completed, the call is forwarded to the secretary.
Instructions on call queues are available at the link.
For our example, you need to create three call queues:
Sales Department (mobile numbers of employees)
Sales Department (internal employee numbers)
Technical Support Department
You must first create internal accounts for employees according to the instructions indicating their mobile numbers.
Go to the Telephony → Call queue. Click on the "Add a new call queue" button.
Creating a call queue for the sales department (for employees' mobile numbers).
Creating a call queue for the sales department (for internal employee numbers).
We indicate that if none of the employees answered the customer's call within 25 seconds, the call should be sent to the employees' mobile numbers.
Creating a call queue for the technical support department.
Instructions for the IVR menu are available at the link.
Go to Telephony → IVR menu. Click on the "Add new IVR menu" button.
Specify the IVR settings according to our description.
Instructions for incoming routes are available at the link.
At the last step, we create an incoming call route for our provider. In the Call Routing → Incoming routing add a new rule.
Fill in the data according to the template: