---
title: "Routing Engine"
canonical: "https://help.callroute.com/space/CKB/774537221/Routing%20Engine"
format: markdown
---
Callroute has a multi-tenant routing engine that allows customers to create their own routing rules for their numbers and users. This allows you to choose the destination endpoint for each individual number you own that transits Callroute.

This article describes the way the routing engine operates.

## Prerequisites

In order to use the routing capabilities of Callroute, your phone system and carrier must be connected to Callroute. Call routing is not available for Microsoft Calling Plan, Operator Connect or 3rd Party Direct Routing number ranges as Callroute is not in the call path of these calls.

**Step 1 - Connect your Carrier**

The first step is to connect your carrier to Callroute using our [BYOC](https://callroute.atlassian.net/wiki/spaces/CKB/pages/698941467) or [BYO SBC](https://callroute.atlassian.net/wiki/spaces/CKB/pages/697565223) feature. If you are using Callroute for your PSTN service connection, this step is automatically done for you.

**Step 2 - Connect Your Service(s)**

Now, connect your phone system services such as [Microsoft Teams](https://callroute.atlassian.net/wiki/spaces/CKB/pages/698580998), [Webex Calling](https://callroute.atlassian.net/wiki/spaces/CKB/pages/699006999) or your on-premises VoIP platforms using [SIP Trunks](https://callroute.atlassian.net/wiki/spaces/CKB/pages/697565230).

**Step 3 - Add Your Number Range(s)**

Now the [number range(s)](https://callroute.atlassian.net/wiki/pages/createpage.action?spaceKey=ckb&title=Number%20Management&linkCreation=true&fromPageId=774537221) associated to your carrier service. If you are using Callroute for your PSTN service connection, this step is automatically done for you.

## Routing Logic Explained

Each compatible number range has symmetrical bidirectional routing. You must assign a default outbound route to a range. The outbound route will always need to be the carrier who supplies the numbers to you.

> ⚠️ Choosing another carrier who does not supply the number range to you may result in your Caller ID being changed or a penalty charge added to each call by your carrier for incorrect use.

When the outbound route is set, Callroute will expect incoming calls to these numbers from the defined carrier.

Once Callroute receives a call to your numbers, you can decide how to route them. 

### Default Inbound Route

The default range inbound route allows you to set a downstream phone system as the recipient of all incoming calls to all numbers within that range. 

This route is useful for on-prem VoIP systems where Callroute cannot configure the endpoint directly. It will be down to the receiving phone system to find the assigned endpoint to receive the call.

The default inbound route can be overridden on a per number basis to suit more granular control.

### Per Number Routing

There are cases where some numbers within a range need to be routed to a specific destination. Using Callroute you can assign a number to any of your connected services. When a number has been modified, this setting will override the default inbound route for that number.

## Primary & Secondary Inbound Routing

For any number ranges that are BYOC or Callroute provided, you are able to set a primary and secondary inbound route for each number within a range.

The primary route is always used as the main route for call routing. The secondary route only operates when there is an error response from the primary route. 

Error responses include: 404,503,500, and 488 SIP response codes

The secondary route can be another service connected to your Callroute tenant or an external phone number.

## BYOC Primary & Secondary Outbound Routing 

If you use BYOC as your carrier service, the ability for secondary outbound routing will depend on your carrier. Carriers that support SIP registration will usually re-register your trunks onto their secondary platform in the event of a failure to their primary service. 

IP whitelisted carriers who supply multiple failover routes will be configured in Callroute using an active / passive connection. In the event of failure to the active node, Callroute will attempt to route your calls to the passive node configured for the carrier.

Where a carrier offers no failover, Callroute will not be able to route calls if the primary service is down.

> ⚠️ We do not support inter-carrier failover. You will not be able to choose an alternative carrier to route your outbound calls in the event of primary failover automatically. You can manually change the outbound route on your number range. However, you must be confident that your secondary carrier is able to onwardly route your calls from these numbers.

## Callroute PSTN Primary & Secondary Outbound Routing

If you are using Callroute / Sipsynergy PSTN calling services, we have multiple carriers connected with failover routing configured automatically. We will always attempt to route the call out through the most cost efficient carrier first before failing over to our other carriers. This happens without need for configuration by you.

## Service to Service Routing (on-net)

If you are a hybrid voice customer with multiple phone systems connected to Callroute, calls between systems are routed within our platform. For this to operate as expected, the number ranges **must be** defined in Callroute that contain both the calling and called number.

If the condition matches, then these calls are not sent to your carrier. Instead they are routed and contained within Callroute. This means that you will not be charged minutes for these calls and your carrier will have no visibility of these calls ever being made.

### Scenario 1: User A (VoIP A) ---> User B (VoIP B)

You have connected two phone systems, VoIP A and VoIP B to Callroute and configured a number range for each system on Callroute. When User A places a phone call to User B, Callroute will detect that it knows User B’s number and intended destination and route the call directly to the VoIP B phone system.

### Scenario 2: User A (VoIP A) ---> User C (Microsoft Teams)

You have connected a VoIP phone system (VoIP A) and Microsoft Teams to Callroute and defined the number ranges for both systems. When User A places a call to User C, Callroute will detect that User C is located in Microsoft Teams and route the call over Direct Routing to Teams directly.

> ⚠️ This only works when using Callroute for your Microsoft Teams voice services, either BYOC or our PSTN Services.

### Scenario 3: User A (VoIP A) ---> User D (Microsoft Teams Calling Plan | Operator Connect | 3rd Party Direct Routing)

You have connected a VoIP phone system (VoIP A) and Microsoft Teams to Callroute. You have defined the number range for VoIP A and synced your Microsoft numbers from your Teams tenant. You have assigned User D a phone number from your Microsoft Teams calling plan number range.

When User A calls User D, this call will route over your BYOC or PSTN connection and into Microsoft Teams phone system. This call **will not** be routed on-net and you will be charged the appropriate call fee by the carrier used. 

The same behaviour is applied if User D has been assigned an Operator Connect or a 3rd Party Direct Routing. 

## Routing of Extensions

Callroute supports inbound extension dialling for Microsoft Teams only. Extension numbers must be presented in the following format

`tel:+441234567890;ext=1234`

When enabling users in Teams you can assign an extension manually or use either [magic extensions ](https://callroute.atlassian.net/wiki/spaces/CKB/pages/721584131)or the last 4-digits of the user’s DDI. 

> ⚠️ Extension dialling will only work with BYOC, or Callroute PSTN user numbers. Extension dialling is not supported for user with Microsoft Calling Plan, 3rd Party Direct Routing or Operator Connect numbers.

When calling Teams extensions from another phone system using Callroute, Callroute must receive the called LineURI in the above expected format in order to route. If the extension is not found in the routing table, the extension will be stripped from the called number and the call routed out to your BYOC or PSTN carrier.

## Routing of Unconfigured Numbers

Numbers that are imported into Callroute will have a default state of inactive or unconfigured. In this state, the default inbound route is used to route inbound calls destined to these numbers. It will then be up to the destination phone system to decide the outcome of the call. This is the same for internal and external calling.

## Routing of Numbers between Callroute tenants

Number routing is contained within each Callroute tenant. It is not possible to route calls between different Callroute tenants on-net. In the cases where Company A calls users in Company B, these calls will transit your carrier PSTN service and you will incur call charges like any other external phone call.