When you set up an outside line manually you have to “cut” the incoming number in Gateway group to match the pattern that you have defined in “Inbound routes”.
E.g. the incoming phone number is 02871 2397567 and you want to map the last 3 digits (567) to extension 12, you have to cut off 02871 2397. First step would be to set the "Pattern" in "Inbound routes" to ^(567) and "Target" to 12. The next step is to define the filtering rules in "Gateway groups".
Depending on provider, incoming numbers can be formatted in different ways. Therefore, all possible formats should be checked.
|
|
| Prefix |
| City prefix |
| Number | Comment | ||
---|---|---|---|---|---|---|---|---|---|---|
|
|
| 0049 |
| 2871 |
| 2397 |
| 567 | Incoming number 0049 2871 2397567 |
|
|
| +49 |
| 2871 |
| 2397 |
| 567 | Incoming number +49 2871 2397567 |
|
|
| 49 |
| 2871 |
| 2397 |
| 567 | Incoming number 49 2871 2397567 |
|
|
| 0 |
| 2871 |
| 2397 |
| 567 | Incoming number 02871 2397567 |
|
|
|
|
|
|
| 2397 |
| 567 | Incoming number 2397567 |
|
| (?: | 0049|\+49|49|0 | )? |
|
|
|
|
| Check wether 0049 or +49 or 49 or 0 is part of the incoming number. If yes, this part will be cut off. |
| (?: |
|
|
| 2871 | )? |
|
|
| Check wether 2871 is part of the incoming number. If yes, this part will be cut off. |
^(?: |
|
|
|
|
|
| 2397 | )? |
| Check wether 2397 is part of the incoming number. If yes, this part will be cut off. |
|
|
|
|
|
|
|
|
| (.*) | All numbers that are left, will be saved in $1 |
^(?: | (?: | (?: | 0049|\+49|49|0 | )? | 2871 | )? | 2397 | )? | (.*) | Complete expression. |
^(?: ( ?: (?: 0049|\+49|49|0)?2871)? 2397 )?(.*) 567 will be saved in $1 and compared to the pattern in "Inbound routes".
If you want to use the complete number 2397567 in “Inbound routes”.
The filtering rules should look like this:
|
| Prefix |
| City prefix |
| Number | Comment |
---|---|---|---|---|---|---|---|
|
| 0049 |
| 2871 |
| 2397567 | Incoming number 0049 2871 2397567 |
|
| +49 |
| 2871 |
| 2397567 | Incoming number +49 2871 2397567 |
|
| 49 |
| 2871 |
| 2397567 | Incoming number 49 2871 2397567 |
|
| 0 |
| 2871 |
| 2397567 | Incoming number 02871 2397567 |
|
|
|
|
|
| 2397567 | Incoming number 2397567 |
| (?: | 0049|\+49|49|0 | )? |
|
|
| Check wether 0049 or +49 or 49 or 0 is part of the incoming number. If yes, this part will be cut off. |
^(?: |
|
|
| 2871 | )? |
| Check wether 2871 is part of the incoming number. If yes, this part will be cut off. |
|
|
|
|
|
| (.*) | All numbers that are left, will be saved in $1 |
^(?: | (?: | 0049|\+49|49|0 | )? | 2871 | )? | (.*) | Complete expression. |
^( ?: (?: 0049|\+49|49|0)?2871)?(.*) 2397567 will be saved in $1 and compared to the pattern in "Inbound routes".
Explanation:
(.*) – all numbers which are still there
$1 – is a variable, all from (.*) will be saved in this variable
(?:XXXXX)? – means if XXXXX exists, this part will be “cut”.
| – is "or"