Dial plan scenario 6: Forwarding calls to another SIP extension on schedule - Sipelia™ 2.11

Sipelia™ User Guide 2.11

Applies to
Sipelia™ 2.11
Last updated
2022-01-10
Content type
Guides > User guides
Language
English
Product
Sipelia™
Version
2.11

In this scenario, dial plan rules are used to define a range of SIP extensions for calls that must always reach the recipients, while other SIP extensions are automatically forwarded to a new destination. This can be useful to route calls from SIP intercoms to a call center during the night for example.

Scenario

  • What do you want to do? During off-hours for example, calls made to SIP extensions between 4000 and 4500 must be routed normally to the requested recipients, while other calls must be forwarded to extension 1001, which can be the extension of a SIP endpoint (or SIP client) in a security office for example.
  • What you need to do before defining the rule? Define the range of SIP extensions that must always be routed and the specific SIP extension to which other calls will be forwarded. You also need to have a schedule defined in Security Center to be used in the dial plan rule.
  • How can you do it? You need to define two separate rules listed in the right order in your dial plan:
    • The first rule looks for any call made to reach SIP extensions between 4000 to 4500, and route them normally.
    • The second rule will take calls to any other SIP extension and forward them to extension 1001.
IMPORTANT: The rules need to be in the right order in the dial plan to work as described in this scenario.

Example of the dial plan

The following is an example of a dial plan that accomplishes the above mentioned scenario.
  1. Scenario6-NightRoutingNormal;DB3ABC7D-FD1B-4A92-A392-4408404F7D7B;ON;local;local;(.*);\b0*4([0-4][0-9]{2}|500)\b;(.*);(.*);
  2. Scenario6-NightRoutingSpecial;DB3ABC7D-FD1B-4A92-A392-4408404F7D7B;ON;local;local;(.*);(.*);(.*);1001;

Rule 1: Normal night routing

The first rule listed in the dial plan shown below tells Sipelia™ Server to look for destination SIP extensions between 4000 and 4500, and route them normally.

The value labels identified below correspond to the column labels which appear on the Dial plans page of the Sipelia plugin role.

Value letter Value label Description
A Name The name of the rule indicates that the calls are routed normally.
B Schedule The schedule is set to Off-hours, meaning that the rule will be applied only during that time.
C Status The status is set On, meaning that the rule is currently active.
D Direction from The field is set to local to look for calls that will be originating from Sipelia™ Server.
E Direction to The field is set to local because the calls will remain local to Sipelia™ Server when the rule is applied.
F Source The regular expression is set to (.*), meaning that the call can be made from any SIP extension.
G Destination The regular expression is set to \b0*4([0-4][0-9]{2}|500)\b, meaning that Sipelia™ Server must look for called SIP extensions between 4000 and 4500, as described below:
\b
SIP extension boundary. Used together with the same \b element at the end of the expression, this requires the whole SIP extension to be matched. Starting or ending characters will not be omitted.
0*
Look for any number of zeros before the next character, which is 4.
4
Look for a SIP extension that begins with 4.
([0-4]
Look for a single occurrence of digits 0 through 4 after the first 4.
[0-9]{2}
Look for 2 following occurrences of digits 0 through 9, which now covers extension 4000 to 4499.
|500)
Look specifically for 500 to add 4500 in the search pattern.
\b
Match a SIP extension boundary.
H New source The regular expression (.*) is used. This means that your extension (the source caller) on Sipelia™ Server remains unchanged.
I New destination The regular expression (.*) is used. This means that the called extension remains unchanged.

Rule 2: Special night routing

The second rule listed in the dial plan and shown below tells Sipelia™ Server to look for any call that does not match the first rule, and forward it to extension 1001.

The value labels identified below correspond to the column labels which appear on the Dial plans page of the Sipelia plugin role.

Value letter Value label Description
A Name The name of the rule indicates that the calls are following a special route.
B Schedule The schedule is set to Off-hours, meaning that the rule will be applied only during time.
C Status The status is set On, meaning that the rule is currently active.
D Direction from The field is set to local to look for calls that will be originating from Sipelia™ Server.
E Direction to The field is set to local because the calls will remain local to Sipelia™ Server when the rule is applied.
F Source The regular expression is set to (.*), meaning that the call can be made from any SIP extension.
G Destination The regular expression is set to (.*), meaning that the call can be made to reach any SIP extension.
H New source The regular expression (.*) is used. This means that your extension (the source caller) on Sipelia™ Server remains unchanged.
I New destination The regular expression 1001 is used. This means that the call will always be forwarded to SIP extension 1001.

Result

Once the dial plan is imported into Config Tool, only the highest priority rule will apply. This dial plan results in the following:
  1. When the schedule is satisfied, if any SIP extension dials a number between 4000 and 4500, the call will remain local to Sipelia™ Server and will be routed normally to the requested recipient.
  2. When the schedule is satisfied, if any SIP extension dials any other number, the call will automatically be forwarded to SIP extension 1001.