Page tree
Skip to end of metadata
Go to start of metadata

The DID list feature allows you to put a group a list of DIDs. Then assign a list to a particular route, in order to simplify the routing logic. 

Create a DID file

The first step is to create a csv file as shown below. The first line must read "did" and then each line can contain a unique number in the list. Only a single number per line is permitted. Below is an example of this. 

This can be made in notepad, but the extension has to be ".csv" in order to upload it to the SBC. 

Example List → ListA.csv

Upload the DID List

Go to "Configuration" -> "Routing" -> "DID List"

Click the "Upload" button.

Select your DID list (ensure its .csv) and upload it by pressing the Add button. 

Enter the List Name you would like to assign the list; ensure you keep the file name the same. Then add a description if you would like and verify the DID count is as expected. Then press save. 

You will now see the DID list you uploaded. Keep in mind duplicate names will be rejected; ensure you assign a unique name to each new list you upload. 

DID Query from Basic Call Routing

In a Basic Call Routing dialplan, add a Condition as follows:

(1) Select DID action

Select on of the following from the first drop down box

"Known Destination Number" - To find the destination number (in Request URI user part) of the call in the DID list.

"Known From Number" - To find the From number (in SIP From header) of the call in the DID list.

"Known To Number" - To find the To number (in SIP To header) of the call in the DID list.

(2) Select DID list

Select a DID List from the List drop down.

(3) Specify match action

Enter either ^true$ or ^false$ in the expression field.

^true$ - It is a match if the number is found in the DID list.

^false$ - It is a match if the number is NOT in the DID list.

This option enable you to use matching/unmatching DID in nested diaplan condition.

In the above example, a search of the From number is performed on DID list "List1". If the number is NOT in the list, the actions in "Actions to perform if condition matches" will be performed. If the number is found in the DID List1, he actions in "Actions to perform if condition doesn't matches" will be performed

DID Query from Advanced Call Routing

When routing a call using Advanced Call Routing, you can make a query to see if a DID belong to a list and use the result to route the call.

To see if DID 1235 belongs to DID list1, add the following to the dialplan.

    <action application="set" data="did_result=${did_list(List1 1235)}"/>

The variable did_result will be "true" if the DID exists in the list, otherwise "false".

You can also create a condition as follow:

    <regex field="${did_list(List1, ${destination_number})}" expression="^true$">

This condition matches if the destination number is found in DID List1.

Pattern matching DID

Pattern matching(MySQL regex) can be used with the list of did numbers in the csv file.

Regular expression meta-characters

*The asterisk (*) metacharacter is used to match zero (0) or more instances of the strings preceding it
+The plus (+) metacharacter is used to match one or more instances of strings preceding it.
?The question(?) metacharacter is used to match zero (0) or one instances of the strings preceding it.
.The dot (.) metacharacter is used to match any single character in exception of a new line.
[abc]The charlist [abc] is used to match any of the enclosed characters/digits.
[^abc]The charlist [^abc] is used to match any characters/digits excluding the ones enclosed.
[0-9]The [0-9] is used to match any digit from 0 through to 9.
^The caret (^) is used to start the match at beginning.

The backslash (\) is used to as an escape character. To add backslash escape character in the did list append with extra backslash (\\)


^234567[0-9]{2}   →  matches all the did from 23456700 - 23456799

^(\\+1)?34567    →  matches the did +134567 and 34567

^23456[79]   → matches the did 234567 and 234569

  • No labels