Setting individual non-working hours for a provider account
Formulation of the problem
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.
Solution
Method 1
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
Method 2
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.
ExecIfTime command
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".
Last updated