03-28-2014, 10:49 AM
Regular expression, often called a pattern, is an expression that specifies a set of strings. A regular expression provides a concise and flexible means to “match” (specify and recognize) strings of text, such as particular characters, words, or patterns of characters. Regular expression is used by many text editors, utilities, and programming languages to search and manipulate text based on patterns.
Regular expression can be used to define IP phone dial plan. Dial plan is a string of characters that governs the way for IP phones to process the inputs received from the IP phone’s keypads. IP phones support the following dial plan features:
l Replace Rule
l Dial-now
l Area Code
l Block Out
You need to know the following basic regular expression syntax when creating dial plan:
It’s account-oriented for Dial Plan, you can choose to specify any rule to any an account and will not affect other accounts.
You can input corresponding digit into the column, here:
1 stands for account 1
2 stands for account 2
And so on
And it allows you to input one or more digits to define multiple accounts like below:
1,2,3,4,5,6 (it stands for working for all 6 accounts)
1,3,5 (it stands for this rule will only work for account 1,3,5)
And []color=redNULL/EMPTY[/color] stands for working for all accounts.
Replace rule
Replace rule is an alternative string that replaces the numbers entered by the user. IP phones support up to 100 replace rules, which can be created either one by one or in batch using a replace rule template.
To create a replace rule via web user interface:(Take T46G-V72 for example)
1. Click on Settings->Dial Plan->Replace Rule.
2. Enter the string in the Prefix field.
3. Enter the string in the Replace field.
4. Enter the desired line ID in the Account field or leave it blank.
If you leave the field blank or enter 0, the replace rule will apply to all accounts on the IP phone.
5. Click Add to add the replace rule.
Replace Rule Template
The replace rule template helps with the creation of multiple replace rules. The existing
replace rules on the phones will be overwritten by the downloaded replace rules. After setup, you need to place the replace rule template to the provisioning server and specify the access URL in the configuration files.
When editing a replace rule template file, learn the following:
l <DialRule> indicates the start of the template file and </DialRule> indicates the
end of the template file.
l Create replace rules between <DialRule> and </DialRule>.
l When specifying the desired line(s) to apply the replace rule, the valid values are 0
and line ID. The digit 0 stands for all lines. Multiple line IDs are separated by
commas.
l At most 100 replace rules can be added to the IP phone.
Use the following procedures to customize a replace rule template.
To customize a replace rule template:
1. Open the template file using an ASCII editor .
2. Add the following string to the template, each starting on a separate line:
<Data Prefix=”” Replace=”” LineID=””/>
Where:
Prefix=”” specifies the numbers to be replaced.
Replace=”” specifies the alternate string instead of what the user enters.
LineID=”” specifies the desired line(s) for this rule. When leaving it blank, this
replace rule will apply to all lines.
3. Specify the values within double quotes.
4. Save the change and place this file to the provisioning server .
The following is an example of a replace rule file:
Explanations of Replace Rule:
1. Exact match
(1) prefix=0, replace=0086
When you dial 0 out, the number will be replaced by 0086 automatically
(2) prefix=123, replace=0592
When you dial 123 out, the number will be replaced by 0592 automatically.
2. Partial match
If need to replace the unknown contents, then you can use (.) or (x). The content in () stands for a variable, the first variable is expressed by $1, the second variable is expressed by $2, the rest can be done in the same manner.
For example: if you want to replace the any input content with the content beginning with 8. Input (.) in Prefix box, and input 8$1 in Replace box .
(1) prefix=(xxxx), replace=9$1
When you dial out any four characters on your phone, the IP phone will replace the number added with 9.For example, you dial 8742 out, the number will be replaced by 98742 automatically.
If you dial 55555 out, the replace rule can't take effect.
(2) prefix=(.), replace=9$1
When you dial out any string on your phone, the IP phone will replace the number added with 9. For example, you dial 06612 out, the number will be replaced by 906612 automatically.
(3) prefix=9(.), replace=$1
For example, you dial 9321 out, the number will be replaced by 321.
If you dial 99987 out, the number will be replaced by 9987 automatically. And so on.
(4) prefix=13([0-9])(.), replace=913$1$2
When you dial 1308765 out, the number will be replaced by 91308765.
When you dial 91308765 out, the replace rule can't take effect.
(5)prefix=(21)([1,3]), replace=9$1$2
When you dial 211, the number will be replaced by 9211.
When you dial 214, the replace rule can't take effect.
When you dial 121, the replace rule can't take effect. And so on.
(6)prefix=(xxx)(23), replace=8$1$2
When you dial 55523, the number will be replaced by 855523.
When you dial out 878723, the replace rule can't take effect.
When you dial out 55513, the replace rule can't take effect. And so on.
Dial-now
Dial-now is a string used to match the numbers entered by the user . When entered numbers match the predefined dial-now rule, IP phones will automatically dial out the numbers without pressing the send key. IP phones support up to 100 dial-now rules, which can be created either one by one or in batch using a dial-now rule template.
Delay Time for Dial-now Rule
IP phones will automatically dial out the entered number, which matches the dial-now rule, after a specified period of time.
To create a dial-now rule via web user interface:(Take T46G-V72 for example)
1. Click on Settings->Dial Plan->Dial-now.
2. Enter the desired value in the Rule field.
3. Enter the desired line ID in the Account field or leave it blank.
If you leave the field blank or enter 0, the dial-now rule will apply to all accounts on the IP phone.
4. Click Add to add the dial-now rule.
To configure the delay time for the dial-now rule via web user interface:(Take T46G-V72 for example)
1. Click on Features->General Information.
2. Enter the desired time within 1-14 (in seconds) in the Time- Out for Dial-Now Rule field.
3. Click Confirm to accept the change.
Dial-now Template
The dial-now template helps with the creation of multiple dial-now rules. After setup,
you need to place the dial-now template to the provisioning server and specify the access URL in the configuration files.
When editing a dial-now template, learn the following:
l <DialNow> indicates the start of a template and </DialNow> indicates the end of
a template.
l Create dial-now rules between <DialNow> and </DialNow>.
l When specifying the desired line(s) for the dial-now rule, the valid values are 0 and
line ID. 0 stands for all lines. Multiple line IDs are separated by commas.
l At most 100 dial-now rules can be added to the IP phone.
Use the following procedures to customize a dial-now template.
To customize a dial-now template:
1. Open the template file using an ASCII editor .
2. Add the following string to the template, each starting on a separate line:
<Data DialNowRule="" LineID=""/>
Where:
DialNowRule="" specifies the dial-now rule.
LineID="" specifies the desired line(s) for this rule. When leaving it blank, this rule
will apply to all lines.
3. Specify the values within double quotes.
4. Save the change and place this file to the provisioning server.
The following is an example of a dial-now template:
Area Code
Area codes are also known as Numbering Plan Areas (NPAs). They usually indicate geographical areas in one country . When the entered numbers match the predefined area code rule, the IP phone will automatically add the area code before the numbers when dialing out them. IP phones only support one area code rule.
To configure an area code rule via web user interface:(Take T46G-V72 for example)
1. Click on Settings->Dial Plan->Area Code.
2. Enter desired values in the Code, Min Length (1-15) and Max Length (1-15) fields.
3. Enter the desired line ID in the Account field or leave it blank.
If you leave the field blank or enter 0, the area code rule will apply to all accounts on the IP phone.
4. Click Confirm to accept the change.
Regular expression can be used to define IP phone dial plan. Dial plan is a string of characters that governs the way for IP phones to process the inputs received from the IP phone’s keypads. IP phones support the following dial plan features:
l Replace Rule
l Dial-now
l Area Code
l Block Out
You need to know the following basic regular expression syntax when creating dial plan:
It’s account-oriented for Dial Plan, you can choose to specify any rule to any an account and will not affect other accounts.
You can input corresponding digit into the column, here:
1 stands for account 1
2 stands for account 2
And so on
And it allows you to input one or more digits to define multiple accounts like below:
1,2,3,4,5,6 (it stands for working for all 6 accounts)
1,3,5 (it stands for this rule will only work for account 1,3,5)
And []color=redNULL/EMPTY[/color] stands for working for all accounts.
Replace rule
Replace rule is an alternative string that replaces the numbers entered by the user. IP phones support up to 100 replace rules, which can be created either one by one or in batch using a replace rule template.
To create a replace rule via web user interface:(Take T46G-V72 for example)
1. Click on Settings->Dial Plan->Replace Rule.
2. Enter the string in the Prefix field.
3. Enter the string in the Replace field.
4. Enter the desired line ID in the Account field or leave it blank.
If you leave the field blank or enter 0, the replace rule will apply to all accounts on the IP phone.
5. Click Add to add the replace rule.
Replace Rule Template
The replace rule template helps with the creation of multiple replace rules. The existing
replace rules on the phones will be overwritten by the downloaded replace rules. After setup, you need to place the replace rule template to the provisioning server and specify the access URL in the configuration files.
When editing a replace rule template file, learn the following:
l <DialRule> indicates the start of the template file and </DialRule> indicates the
end of the template file.
l Create replace rules between <DialRule> and </DialRule>.
l When specifying the desired line(s) to apply the replace rule, the valid values are 0
and line ID. The digit 0 stands for all lines. Multiple line IDs are separated by
commas.
l At most 100 replace rules can be added to the IP phone.
Use the following procedures to customize a replace rule template.
To customize a replace rule template:
1. Open the template file using an ASCII editor .
2. Add the following string to the template, each starting on a separate line:
<Data Prefix=”” Replace=”” LineID=””/>
Where:
Prefix=”” specifies the numbers to be replaced.
Replace=”” specifies the alternate string instead of what the user enters.
LineID=”” specifies the desired line(s) for this rule. When leaving it blank, this
replace rule will apply to all lines.
3. Specify the values within double quotes.
4. Save the change and place this file to the provisioning server .
The following is an example of a replace rule file:
Code:
<DialRule>
<Data Prefix="1" Replace="05928665234" LineID=""/>
<Data Prefix="2(xx)" Replace="002$1" LineID="0"/>
<Data Prefix="5([6-9])(.)" Replace="3$2" LineID="1,2,3"/>
<Data Prefix="0(.)" Replace="9$1" LineID="2"/>
<Data Prefix="1009" Replace="05921009" LineID="1"/>
</DialRule>
Explanations of Replace Rule:
1. Exact match
(1) prefix=0, replace=0086
When you dial 0 out, the number will be replaced by 0086 automatically
(2) prefix=123, replace=0592
When you dial 123 out, the number will be replaced by 0592 automatically.
2. Partial match
If need to replace the unknown contents, then you can use (.) or (x). The content in () stands for a variable, the first variable is expressed by $1, the second variable is expressed by $2, the rest can be done in the same manner.
For example: if you want to replace the any input content with the content beginning with 8. Input (.) in Prefix box, and input 8$1 in Replace box .
(1) prefix=(xxxx), replace=9$1
When you dial out any four characters on your phone, the IP phone will replace the number added with 9.For example, you dial 8742 out, the number will be replaced by 98742 automatically.
If you dial 55555 out, the replace rule can't take effect.
(2) prefix=(.), replace=9$1
When you dial out any string on your phone, the IP phone will replace the number added with 9. For example, you dial 06612 out, the number will be replaced by 906612 automatically.
(3) prefix=9(.), replace=$1
For example, you dial 9321 out, the number will be replaced by 321.
If you dial 99987 out, the number will be replaced by 9987 automatically. And so on.
(4) prefix=13([0-9])(.), replace=913$1$2
When you dial 1308765 out, the number will be replaced by 91308765.
When you dial 91308765 out, the replace rule can't take effect.
(5)prefix=(21)([1,3]), replace=9$1$2
When you dial 211, the number will be replaced by 9211.
When you dial 214, the replace rule can't take effect.
When you dial 121, the replace rule can't take effect. And so on.
(6)prefix=(xxx)(23), replace=8$1$2
When you dial 55523, the number will be replaced by 855523.
When you dial out 878723, the replace rule can't take effect.
When you dial out 55513, the replace rule can't take effect. And so on.
Dial-now
Dial-now is a string used to match the numbers entered by the user . When entered numbers match the predefined dial-now rule, IP phones will automatically dial out the numbers without pressing the send key. IP phones support up to 100 dial-now rules, which can be created either one by one or in batch using a dial-now rule template.
Delay Time for Dial-now Rule
IP phones will automatically dial out the entered number, which matches the dial-now rule, after a specified period of time.
To create a dial-now rule via web user interface:(Take T46G-V72 for example)
1. Click on Settings->Dial Plan->Dial-now.
2. Enter the desired value in the Rule field.
3. Enter the desired line ID in the Account field or leave it blank.
If you leave the field blank or enter 0, the dial-now rule will apply to all accounts on the IP phone.
4. Click Add to add the dial-now rule.
To configure the delay time for the dial-now rule via web user interface:(Take T46G-V72 for example)
1. Click on Features->General Information.
2. Enter the desired time within 1-14 (in seconds) in the Time- Out for Dial-Now Rule field.
3. Click Confirm to accept the change.
Dial-now Template
The dial-now template helps with the creation of multiple dial-now rules. After setup,
you need to place the dial-now template to the provisioning server and specify the access URL in the configuration files.
When editing a dial-now template, learn the following:
l <DialNow> indicates the start of a template and </DialNow> indicates the end of
a template.
l Create dial-now rules between <DialNow> and </DialNow>.
l When specifying the desired line(s) for the dial-now rule, the valid values are 0 and
line ID. 0 stands for all lines. Multiple line IDs are separated by commas.
l At most 100 dial-now rules can be added to the IP phone.
Use the following procedures to customize a dial-now template.
To customize a dial-now template:
1. Open the template file using an ASCII editor .
2. Add the following string to the template, each starting on a separate line:
<Data DialNowRule="" LineID=""/>
Where:
DialNowRule="" specifies the dial-now rule.
LineID="" specifies the desired line(s) for this rule. When leaving it blank, this rule
will apply to all lines.
3. Specify the values within double quotes.
4. Save the change and place this file to the provisioning server.
The following is an example of a dial-now template:
Code:
<DialNow>
<Data DialNowRule="1234" LineID="1"/>
<Data DialNowRule="52[0-6]" LineID="1"/>
<Data DialNowRule="xxxxxx" LineID=""/>
</DialNow>
Area Code
Area codes are also known as Numbering Plan Areas (NPAs). They usually indicate geographical areas in one country . When the entered numbers match the predefined area code rule, the IP phone will automatically add the area code before the numbers when dialing out them. IP phones only support one area code rule.
To configure an area code rule via web user interface:(Take T46G-V72 for example)
1. Click on Settings->Dial Plan->Area Code.
2. Enter desired values in the Code, Min Length (1-15) and Max Length (1-15) fields.
3. Enter the desired line ID in the Account field or leave it blank.
If you leave the field blank or enter 0, the area code rule will apply to all accounts on the IP phone.
4. Click Confirm to accept the change.