LogoLogo
www.mikopbx.comTelegram communityForum
English
English
  • MikoPBX Manual
    • Quick start
    • Getting to know MikoPBX
    • System requirements
  • Installation
    • Standalone Computer
    • Virtual Machine
      • VMware ESXi
      • VMware Fusion
      • VirtualBOX
      • VMware Workstation Pro
      • Hyper-V
      • Proxmox
    • Cloud
      • AWS
        • AWS deployment guide
        • AWS Marketplace
      • Microsoft Azure
      • Google Cloud
        • Google Cloud deployment guide
        • Google Cloud Marketplace
      • Hetzner cloud (In dev)
      • Digital Ocean
      • Alibaba Cloud
      • Vultr
    • Docker container
      • Docker installation and creating a user and directories
      • Running MikoPBX in a container
      • Running MikoPBX using docker compose
  • User manual
    • Telephony
      • Extensions
      • Call queues
      • IVR Menu
      • Conferences
      • Sound files
      • Call detail records (CDR)
    • Call Routing
      • Telephony providers
      • Incoming routing
      • Outbound routing
      • Night and Holiday Switch
    • Modules
      • Registration in the modules marketplace
      • Module management
      • Application dialplans
    • Maintenance
      • PBX update
        • Updating from the web interface
        • Updating from the MikoPBX console
        • Updating the docker
      • System log entries
      • Reboot
    • Network and Firewall
      • Network interface
      • Firewall
      • Anti brute force
    • System
      • General settings
      • Time Settings
      • Mail settings
        • Setting up E-mail notifications for the Gmail mail service
      • Asterisk Manager Interface(AMI)
      • System files customisation
  • FAQ
    • Setup
      • Installation on MDADM RAID1
      • Fine-tuning the firewall
      • Migrating MikoPBX to Another Server
        • Transfer Using Backup
        • Transfer using scheduled backup (SFTP)
        • Transfer using rsync
      • Reset to factory settings
      • Monitoring Providers on MikoPBX
    • Management
      • Change the login name
      • The extra disk space has run out, the disk size has increased
      • Storing Recordings in a Shared Windows Folder
      • Resetting WEB Interface Credentials
      • Backup Internet and Provider Re-Registration
    • Troubleshooting
      • Connecting to the PBX using SSH
        • Connecting to PBX using SSH client (Putty)
        • Connecting via SSH (Windows)
        • Connecting via SSH (Linux/MacOS)
      • Connecting to a PBX using WinSCP
      • Getting logs using the tcpdump application
      • Capturing Logs from PBX using Wireshark
      • Traffic Analysis Using Sngrep
      • Adjusting the volume
      • Troubleshooting sound problems
      • Jitter Configuration
    • Incoming Routing
      • Choosing a provider when redirecting to a mobile
      • Notification of Employment, Call Waiting
      • Black and white lists
      • Allow additional dialing of the internal number in the queue
      • Output of information about the did number
      • Setting individual non-working hours for a provider account
      • An example of the implementation of a typical route of incoming calls
      • Routing by DID Number
      • Normalization of incoming phone number
      • Basic IVR example
    • Outbound routing
      • Add P-Preferred-Identity and Remote-Party-ID header
      • Conference with a regular external subscriber
      • Outgoing with internal number dialing
      • Remove all special characters from the dialed number
      • Prohibiting calls via a backup route
      • Calls to emergency numbers
      • Number Templates
        • Uniform distribution of outgoing
        • Sample template: calls to another country
        • How to prohibit the replacement of "+" with 00
        • Changing the number prefix from "+345" to "347"
        • Changing the number prefix from "345, 347" to "+345"
        • Removing the area code from the number
        • Adding the prefix "1" to the number
      • Making Calls Through a Specific Provider
    • Scenarios and cases
      • Generate extensions by REST API
      • Missed Call Telegram Notifications
      • Call the company from your mobile and dial an extension to call a third-party company
      • Sending an incoming fax to email
      • Customer's assessment of the quality of service
      • Simulation of external calls
      • Disabling "off-hours" for VIP numbers
      • Registering multiple accounts from one provider
      • Setting up individual non-working hours for several providers on one host
      • Disable forwarding to mobile for internal calls
      • Unique background music for the queue
      • Pause for Queue agent
      • Dynamic Queue Agents
      • Setting up the "Paging" function
      • Limit the number of authorizations per SIP account
      • Call Monitoring (ChanSpy)
      • Conversion of Call History FreePBX -> MikoPBX
      • SSL Certificate for MikoPBX Web Interface from OPNSense
      • Hiding the Caller’s Number from Employees
    • Interconnections
      • Merging two MikoPBX
      • Integration of MikoPBX and Grandstream UCM6202
      • MikoPBX and FreePBX (PJSIP)
      • MikoPBX and FreePBX (IAX)
    • VoIP providers
      • Mango
      • Zadarma
    • Softphones
      • Bria Solo
      • Sessiontalk
      • MicroSIP
      • Groundwire
      • Zoiper
      • Jitsi
      • PhonerLite
      • Linphone (MacOS)
      • Telephone(MacOS)
      • Configuring webRTC client SIMPL5
      • Softphone.pro
      • 3CX Softphone
      • PortSIP
    • IP telefones
      • Snom D120
      • Yealink T19
    • VoIP gateways
      • GoIP4
      • Grandstream HT503
      • Using a Huawei E173 USB Modem for Calls (chan_dongle)
  • Modules
    • MIKO modules
      • for 1C:Enterprise
        • Панель телефонии 4.0 для 1С
        • Панель телефонии 1.0 для 1С
        • Модуль умной маршрутизации
      • Users groups
      • CRM Bitrix24 integration
      • Autoprovision
      • Let's Encrypt
      • Access control management
      • Module auto dialer
      • Backup
      • Synchronization with LDAP/AD
      • Callback module
  • other
    • Changelog
      • MikoPBX 2024.1
      • MikoPBX 2023.2
      • MikoPBX 2023.1.223
Powered by GitBook
On this page
  • Formulation of the problem
  • Solution
  • Method 1
  • Method 2
  • ExecIfTime command

Was this helpful?

Edit on GitHub
Export as PDF
  1. FAQ
  2. Incoming Routing

Setting individual non-working hours for a provider account

Last updated 1 year ago

Was this helpful?

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

  1. Go to Modules → Dialplan Applications. Create a new application (Asterisk dialplan) following the . Application parameters take the form:

  1. The program code of the created application:

Otherwise, the call will be routed to the employee with extension 201.

  1. 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

  1. Find and copy the provider ID. To do this, go to the configuration of the required provider. In our example, this is SIP-1687941868

  1. Go to System -> System file customization

  1. Open the configuration file extensions.conf for editing.

  1. Set the "Add to end of file" mode. In the black window, add the following code snippet:

[SIP-1687941868-incoming-custom]
exten => _.!,1,NoOp(check time)
    same => n,ExecIfTime(00:00-09:00,mon-fri,*,*?Macro(playback-exit,/offload/asterisk/sounds/other/out_work_times))
    same => n,ExecIfTime(18:00-23:59,mon-fri,*,*?Macro(playback-exit,/offload/asterisk/sounds/other/out_work_times))
    same => n,return

In the above code snippet, you need to make the correct context name.

Format of the created context:

[PROVIDER-ID-incoming-custom]
  • 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:

ExecIfTime(times,weekdays,mdays,months?appname[(appargs)])
  • 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".

ExecIfTime(00:00-08:00,mon-fri,*,*?Macro(playback-exit,/offload/asterisk/sounds/other/out_work_times))

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 (command) to 2003. 2003 is the IVR menu number.

Goto
instructions
Parameters of the created dialplan
The program code of the application being created
Settings in the IVR menu
Incoming route settings
Provider ID
System file customization section
Configuration file "extensions.conf"
Code for extensions.conf