Phone Number Format

You may enter rules for formatting the phone numbers.

The phone numbers that are reported from the PBX system to the PC and the numbers that are send from the PC to the PBX system may be modified with a Search and Replace function.

The phone numbers that are sent from the Tapi Application to the PBX (make call) may be modified as well.

Each line in the list contains an option if direct text compare or a regular expression is used.

The Search and Replace function uses regular expressions. If a search pattern matches, the result from replace with will be used as output. It the search pattern does not match, the original number will be reported unchanged. The entries in the list are processed one after each other. If one match is found the remaining enties will be ignored.

There are three categories:

  • Incoming
    This section is for phone number from incoming calls that are reported from the PBX system to the PC.
  • Outgoing
    This section is for phone number from outgoing calls that are reported from the PBX system to the PC.
  • PC Dialing
    This section is for phone numbers that are dialed on the PC and send to the PBX system

Search for:
Enter the regular expression that will be used to match the phone number.
Hint: The Caret Sign (^) is located on the german keyboard on top left.
Here is a short description of the available expressions:

character description
^ The beginning of the search string (phone number). The expression "^0" matches '0' only at the beginning of the search string.
^ The caret (^) immediately following the left-bracket has a different meaning. It is used to exclude the remaining characters within brackets from matching the target string. The expression "[^0-8]" indicates that only digits from 0 to 8 are allowed.
$ The dollar sign ($) will match the end of the string. The expression "152$" will match the sub-string "152" only if it is at the end of the string.
| The (|) character allows both characters between which it is located. The expression "8|9" allows ‘8’ or ‘9’.
. The dot (.) allows any character (or any digit).
* The asterisk (*) indicates that the character to its left must be present 0 times or more.
+ The Plus sign (+) is similar to the asterisk, only the character to the left must be present at least once.
? The question mark (?) indicates that the character to the left must be present 0 or 1 times.
() The parenthesis affects the order of pattern evaluation and also serves as a tagged expression that can be used when replacing the matched sub-string with another expression.
[] Brackets ([]) enclosing a set of characters indicates that any of the enclosed characters may match the target character.

Replace with:
Enter the expression how the output of the phone number should look like.
\1 represents the first matched expression enclosed by parentheses '( )' from the search pattern field.
\2 the second...

Check:
You can check your input directly here. Enter a call number in the Call Number field that you wish to test with the Search/Replace. In the Output field the modified call number is displayed. If there is an error in the regular expression, it is indicated here. If the expression from Search for is not found, the call numbers will be output directly without any changes.

Examples:

Effect search pattern replace with
Remove a leading 0 from the phone number ^0(.*) \1
Replace a leading 80 at the beginning of the phone number by a 0 ^80(.*) 0\1
Remove a private pin number that may be identified by a 50 followed by a 3 digit pin. ^50[0-9][0-9][0-9](.*) \1
Suppress all phone numbers that are internal (not more than 3 digits). ^[0-9][0-9][0-9]$
Add an access code (leading 0) to all numbers with more than 3 digits (e.g. all external numbers). ^([0-9][0-9][0-9].+) 0\1
Add an area code and prefix (03012345) to all internal numbers (1 to 3 digits). ^([0-9][0-9]?[0-9]?)$ 03012345\1
Adding an area code to all numbers not beginning with 0 and containing at least 4 digits (thus not internal). ^([^0][0-9][0-9][0-9].*) 08151\1

Version 7.0