SBM powered by Microsoft Lync Administrator's Guide 2010-11
2-58
Complete the Setup Wizard
PSTN Configuration
The first part of the expression, [\+]?, specifies that the incoming number may
either begin with + or not. The next part of the expression, [-\*\#\d]+, specifies
that the incoming number can include one or more of any of the following
values in any order:
-
*
#
A digit (0 to 9)
For example, all of these incoming phone numbers match this regular expres-
sion:
123-456-7890
+123-456-7890
12-34-5678
#12-34-5678
*
Because the parentheses surround the entire expression, the Media Gateway
outputs the phone number exactly as it receives the number.
If you want select all incoming phone numbers, but remove a leading + when
present, you would move the parentheses as follows:
[\+]?([-\*\#\d]+)
This mask selects the same phone numbers as the default mask (including
both those with a leading + and those without). However, because the paren-
theses exclude the part of the expression that selects the +, the Media Gateway
removes the + in the outgoing number.
Next, examine another use case. You want to select numbers with a particular
leading string, +123 or 123, and then to strip that string. You could use a mask
such as this:
[\+]?123(([-\*\#\d]{7}+))
Note that this mask specifies the minimum number of digits that must be
matched by [-\*\#\d] in the curly brackets. Thus it prevents the Media Gateway
from mapping phone numbers that happen to match leading string within the
phone number itself. The table below explains in more detail.