Applies to VoipNow 3 and higher!
Time intervals are used in call filtering, call routing and also in charging plans. As a VoipNow administrator, you might need to export time intervals from one server to another, or from your account to another type of account - Service Provider, Organization, or User.
Defining time intervals for each server or for each account is an option, but it's time consuming. Instead, you could consider exporting, importing, or cloning them using a script that will save you time and effort. This article details how to work with the script.
Download the script.
wget -O time_interval.pl https://raw.githubusercontent.com/4psa/voipnowtoolbox/master/time_interval.pl
Install the needed Perl libraries.
yum install perl-DBD-mysql perl-JSON
Run the script.
The available options will be displayed:
Cloning time intervals on a different account
To clone an existing time interval on a different account, you need to know the ID of the time interval and the client ID of the destination account.
Let's assume that the ID of the After Hours matching time interval created on the Admin level (Unified Communications >> Time Intervals) is 21, and let's copy the time interval on the Service Provider with ID 2.
TimeInterval AfterHours has been added on accountID: 2
Saving time intervals to a file
Assuming we want to create the same time interval on a different server, we need to save it to a file and restore it where it is needed.
In our example, we will use the same time interval with ID 21, used for After Hours matching, and we will run the following command:
Time Interval AfterHours saved in afterhours.json
Restoring time intervals from file to an existing account
Let's restore the time interval saved earlier to an existing account with ID 2. We will use the following command:
TimeInterval AfterHours has been restored on accountID: 2
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.