Routing rules
Match destination prefixes and send calls to networks, VMGateClients, or SIM slots using priority or weight.
Routing rule basics
Routing Rules define where VMGateServer sends the outbound GSM leg: destination prefix, competition mode among targets, and the pool of networks, VMGateClients, or SIM slots that may take the call.
Dialpeers (next chapter) connect ingress — a Customer’s SIP trunk — to the routing rules that may be used for that traffic. Create routing rules and add targets first; without dialpeers, ingress calls have no path into your rules.
Create a routing rule
Open Routing Rules and click Add Rule. Choose How targets compete:
- Weight (default) — least-loaded VMGateClient wins; ties break by higher weight.
- Priority — lower priority numbers are tried first (
0= highest); VMGateServer round-robins among targets at the same priority level.
Enter a numeric Code (destination prefix) or leave it empty for a catch-all (* (any)). The Label fills from the dialplan when you leave the code field — for example country or destination name.
After the rule is created, open the ⋮ menu → Targets and add at least one target. A rule with no targets cannot place traffic.
Manage routing rules
The table shows Code, Assignment (Priority or Weight), optional Trunk scope, Label, a summary of Targets, and Status.
Use Edit (⋮ menu) to change assignment mode, code, label, optional SIP trunk filter (All trunks or one trunk), and whether the rule is active. Use Targets to add or remove target rows. Use Remove rule to delete the rule.
When a rule is scoped to one SIP trunk, it only applies to calls on that trunk. All trunks lets any trunk linked by a dialpeer use the rule, as long as the called number matches the prefix.
Destination prefixes
The Code is a digit prefix matched against the called number after ingress processing (tech prefix stripped). Example: 374 matches Armenian destinations starting with those digits.
Leave the code empty for a catch-all rule. When several rules could match, longest prefix wins. Place catch-all rules carefully so they do not override more specific routes.
Routing targets
From the ⋮ menu, choose Targets to manage where matched calls go. Click Add target after filling the form:
- Whole network — any authorized VMGateClient on that network may take the call.
- Single VMGateClient — pin traffic to one device.
- SIM slot on a VMGateClient — use slot 1 or 2 on a multi-SIM client.
Mixed target types on one rule are allowed. Set Priority (0–9) or Weight (1–99) per target depending on the rule’s assignment mode. Remove stale targets when clients are decommissioned.
Priority mode
In Priority mode, targets with lower priority numbers are tried first (0 = highest). Within the same priority level, VMGateServer round-robins among eligible targets.
Use priority when you want a primary pool with an explicit backup tier — for example priority 0 on network A, priority 1 on network B.
Weight mode
In Weight mode, the least-loaded VMGateClient wins among eligible targets; ties break by higher weight (1–99). Use weight for load spreading across a homogeneous client fleet without strict ordering.
Switching assignment mode on an existing rule changes how targets compete — place a test call after edits.