Simple Wizard Dial Plans

A Simple Wizard dial plan is a table of rules edited in the portal, with no script to write. Create one on the Dial Plans page by choosing the Simple Wizard type. Its page has a tab for outgoing call rules and a tab for incoming call rules, each with a list of the rules and a form above it for adding a rule, or changing one picked from the list.

Rules are tried in priority order, and the first rule that matches the call decides what happens to it. A call that matches no rule is declined. The Test run panel tries a made up call against your saved rules and shows which rule matched and why the ones before it didn't.

Each of the fields in a rule is explained below.

  • Priority: controls the order the rules are tried in. Lower numbers are tried first.
  • Description: a short description of the rule, to help recall its purpose.
  • Disable: keeps the rule without it matching anything, so it can be switched back on later.

Rule matching

For outgoing calls the match is made against the number dialled. There are three ways to match.

  • Exact: only matches if the number dialled is exactly the pattern.
  • Prefix: matches the pattern against the start of the number dialled. Prefix matching supports the Asterisk pattern characters: X is any digit, Z is 1 to 9, N is 2 to 9, [1-5] is one of a set, and . is any character. A leading _ is optional.
  • Regex: treats the pattern as a regular expression and matches it against the number dialled.

Incoming rules have two checks that decide whether the rule applies. The first is which of your SIP accounts the call is for: any of them, a specific account, or accounts whose username matches a regular expression. The second is an optional regular expression the caller must match. Leave it empty and the rule matches any caller.

Time matching

Time matching applies only to incoming rules set to apply at specific times. The time of the call is converted to the time zone in your settings and checked against the rule's days and times, so the time zone needs to be set first. The rule applies from the start time up to the end time. An end time before the start time runs over midnight, so 18:00 until 08:00 covers the night. Summer time is allowed for, so 09:00 is 09:00 local time all year round.

Time zones are named the standard way, by region and city, such as Europe/Dublin or America/New_York. On the Settings page, start typing a city or the zone's name, such as Dublin or Irish, and pick from the list. A time zone saved on the previous SIPSorcery, such as (UTC) Dublin, Edinburgh, Lisbon, London, still works, and is shown as the zone it stands for the next time you open Settings.

Each rule keeps the time zone it was saved with. If you change your time zone later, open and save each time rule again to move it to the new one.

Call processing

The final part of a rule decides what happens to a call that matches it. The commands are described below.

  • Dial: forwards the call to a single destination through a chosen provider, or local for one of your SIP accounts. The destination is usually ${dst}, the number that was dialled.
  • DialAdvanced: takes a full dial string, which can forward the call to several destinations. & rings destinations together and | tries the next when everything before it has failed. The ring time is the number of seconds each part may ring before the next is tried; empty means 30.
  • Reject: sends an error response to the caller, which ends the call immediately. The reject reason is optional, and without it the standard text for the response code is used.

Examples

Destination match

The destination match for outgoing calls applies to the number that was dialled.

Match typePatternWill match when
Exact100The caller dials 100.
Exactjoe.bloggsThe caller dials joe.bloggs.
Prefix9The caller dials any number starting with 9, e.g. 91234 or 999.
Prefix0011The caller dials any number starting with 0011, e.g. 00116312568393 or 001133223232.
PrefixXXZThe caller dials any number whose first two digits are 0 to 9 and third digit is 1 to 9, e.g. 00123456 or 01238383.
PrefixXZNThe caller dials any number whose first digit is 0 to 9, second digit is 1 to 9 and third digit is 2 to 9, e.g. 012333 or 222444.
Regex^00346[78]The caller dials any number starting with 003467 or 003468, e.g. 0034671234 and 0034681234.

Commands

CommandOptionsExplanation
DialAdvanced joebloggs@local&12345678@provider1 The call is forwarded to the joebloggs SIP account and to 12345678 through the provider1 SIP provider at the same time.
DialAdvanced ${dst}@provider1|${dst}@provider2 The call is first forwarded to the number dialled through provider1, and if that fails it is forwarded to the same number through provider2.

Changes from the previous Simple Wizard

  • Only the first matching rule is used. The previous Simple Wizard ran every rule that matched, so a failed Dial moved on to the next matching rule. To try another destination when the first fails, use DialAdvanced with |.
  • DialAdvanced no longer has a call duration: an answered call can't be given a time limit.
  • Incoming rules can no longer match on the provider a call came through. Give each provider its own SIP account to send incoming calls to, and match on the account; see Incoming call processing.
  • The Highrise lookup command has been removed.
  • A rule can't use a SIP provider that has been made read only; see SIP Providers.