Enswitch uses three related concepts in order to build a powerful and flexible system to route and bill calls correctly. Each concept, Outbound groups, Peers, and Routes has their own detailed documentation, but this document gives an overview of how they work together.
How routing is configured
Routing and billing of calls is configured in the following order:
- Outbound groups. An outbound group is a set of external destinations that are billed at the same rate. For example, if calls to UK land lines are all billed at the same rate, then "UK land lines" could be an outbound group.
- Peers. Peers are services that will take your calls (e.g., your own facilities, or a company) and forward them to the PSTN.
- Peer outbound costs. Using a combination of Peers and Outbound groups, a cost is set for each Peer to call each Outbound group.
- Routes. A route is identified by a prefix of the number to be called. When an outbound call is made, the route with the longest prefix that matches is used. The routes are added with their prefixes, and for each an Outbound group and the primary and backup Peers are defined.
The end result is a database configuration that resembles the tables below. The Outbound groups and Peers tables are populated first, and data is then pulled from them to help fill the Peer outbound costs and Routes tables.
How routing works
When an outbound call is made, the configuration that's been entered above is used to choose which Peer to send the call to, and how much to charge.
The diagram below illustrates how routing works for an example call:
- A call is made to 00441234567890.
- The system looks up the routing table and chooses the route with the longest matching prefix, which is "00441". This route has "UK land lines" defined as the Outbound group, and "ABCtel" defined as the primary Peer.
- The system looks up the route's combination of Outbound group and Peer in the Peer outbound costs, and notes the corresponding rate to bill the call at.
- The system forwards the call on to the Peer defined by the Route.