Inbound Route Import Tool

Click here for the code.

Click here for a sample import.


 

The Inbound Route Import Tool, or irimport is a command line program for bulk importing inbound route and/or DID information from a properly formatted CSV file. The program takes a single argument: the CSV file to be imported, and ignores all other arguments passed to it. The program will verify that the specified file exists and will exit with an error status if does not. Attempting to use the program with no arguments will simply display usage information and the program will exit normally.

An example use of the program is:

irimport example.csv

It is imperitive that the CSV file specified when running the program is formatted in such a way that the program can use it. The required format uses four columns: DID, Description, Destination Type, and Destination ID. The file should have one row per inbound route to be imported. Information in columns beyond the fourth will be ignored by the program.

An example CSV file might be:

18281234567,Main,ivr,3
18282345678,Support,timecondition,1
18283456789,Sales,ringgroup,600
18284567890,Unused,terminate,hangup
18285678901,Direct,extension,101

In each line of the above example, the first column contains the DID to be used with the inbound route. For each DID, please enter an eleven digit unsigned integer in order to avoid errors.

Following the DID is the Description of the inbound route. For each Description, please use an alphanumeric string. Spaces may be used, but please avoid punctuation and other symbols.

Following the Description is the Destination Type. At present the program support five Destination Types:

terminate
extension
ivr
timecondition
ringgroup

Please use one of the five stated values. Use of other values will result in an error and an unsuccessful import of the DID. Note that this will not cause the program to exit. I’ve taken the above example CSV file and edited it slightly:

18281234567,Main,ivr,3
18282345678,Support,timecondition,1
18283456789,Sales,ringgroup,600
18284567890,Unused,example,hangup
18285678901,Direct,extension,101

Note that on the fourth line, I’ve replaced terminate with example. Now when the program runs using that CSV file as the argument, the following output is displayed:

18281234567 imported successfully.
18282345678 imported successfully.
18283456789 imported successfully.
Error: 18284567890 NOT imported successfully.
18285678901 imported successfully.

Finally, following the Description Type is the Description ID. Acceptable values for the Description ID depend on the Description Type.

Acceptable values for the ivr and timecondition types are unsigned integers which correspond with the ID of the IVR or Time Condition. To obtain this value, you may copy the link address of the IVR or Time Conidition from within the pbxadmin interface. The ID will be at the end of the string.

Acceptable values for the extension and ringgroup types are unsigned integers which correspond with the Extension Number or Ring Group Number. These values can easily be obtained from within the pbxadmin interface and their locations should be obvious to anyone familiar with the interface.

Acceptable values for the terminate type are as follows:

hangup
congestion
busy
zapateller
musiconhold
ring

The values correspond with the available options within the pbxadmin interface.