Dispatcher
Routes the call based on the caller's number. Each named rule creates its own output, and numbers that match nothing go out through Unknown.
At a glance
| Outputs | one per rule, labeled with the rule's Name, plus Unknown |
| Fields | a table of Name and Regular expression, one line per rule |
| What's compared | the caller's number |
| Matching | the expression must cover the whole number, not just its start |
| Number of rules | unlimited, one per line |
How it works
The module compares the caller's number to the regular expressions you have declared, in the order of the table. The first whose expression matches wins, and the following ones are not evaluated.
The name you give a rule becomes the label of its output on the module. You can therefore see on the diagram where each category of caller goes.
The expression is compared to the whole number. Writing 02 only matches a caller whose number is exactly "02." For every number starting with 02, you must write 02\d+. This is by far the most common source of confusion on this module, and it's what the help text at the top of the window reminds you:
> Checks the caller's number against regular expressions:
> 02\d+ matches numbers starting with 02, 00\d+ all those starting with 00, \+32\d+ all those starting with +32.
The Unknown output receives calls that no rule matched. It also receives calls whose rule did match but whose output was left unconnected: the module doesn't fall through to the next rule, it falls back to Unknown.
If the Unknown output isn't connected to anything, the call is hung up without a word. As everywhere in the plan, a triggered output leading nowhere ends the call.
What to fill in
| Field | What's expected | If you leave it blank |
|---|---|---|
| Name | the label of the output on the module, for example "Belgium customers" | the output still exists, labeled with a question mark, and becomes unreadable on the diagram |
| Regular expression | a regular expression covering the whole number, for example \+32\d+ | the output still shows on the module, but the rule never matches any call |
Step by step
- Place the Dispatcher module and connect the previous node to its input.
- Open it with a double click, then click Add to create a first rule.
- Enter a Name that states the intent, and a Regular expression that covers the whole number.
- Add one line per caller category, and order them from most specific to broadest: the first one that matches wins.
- Close the window with Save. The module now shows one output per rule, labeled with its name, plus the Unknown output.
- Connect each output to its destination.
- Connect Unknown, otherwise any caller outside your rules will be hung up.
- Click Save in the editor's toolbar, then Apply changes.
- Make a real call from a number that should match a rule, then from a number that matches none, and check that both go where you expected.
If it doesn't work
All calls go out through Unknown. The expression only covers the start of the number. Replace 02 with 02\d+, and +32 with \+32\d+, the + needing to be escaped with a backslash.
A rule never triggers, even though its expression is correct. A rule placed before it also matches, and the first one wins. Move the more specific rule above the broader one, or narrow the broader one.
The call is hung up for numbers that match no rule. The Unknown output isn't connected to anything. Connect it to your greeting, an announcement, or a voicemail box.
The rule matches, but the call still goes out through Unknown. This rule's output was left unconnected. The module doesn't move on to the next rule, it falls back to Unknown. Connect this rule's output.
An output on the module shows a question mark. The corresponding rule has no Name. Reopen the module and name it: only the name lets you recognize the output on the diagram.
How the call flow is built, explained in pictures
See the Dial plans page