# Mitel integration guide

URL: https://www.callshift.ai/docs/mitel

Mitel keeps the call, the routing, the ACD and the reporting. It sends the calls you choose to a CallShift agent over a SIP trunk; the agent answers, handles the request, and transfers the caller back to Mitel when a person is needed. Nothing changes for your phones or your agents.

## How the call flows

1. **Mitel answers the line**: The call reaches MiVoice Business, MiVoice 5000 or MiVoice Office 400 from the PSTN. Your routing decides which calls go to the agent.
2. **Through your border**: Mitel sends the call over a SIP trunk, through MiVoice Border Gateway or your SBC, to the CallShift origination URI.
3. **The CallShift agent**: The agent of the called number answers, follows its call flow and calls your tools.
4. **Back to Mitel**: When a person is needed, the agent transfers the caller to a number that reaches a Mitel extension or ACD path.

Caller → PSTN → Mitel → MiVoice Border Gateway or SBC → SIP trunk → CallShift agent → transfer back to a Mitel extension or ACD path.

## Supported Mitel platforms

| Platform | Connection path | Status |
| --- | --- | --- |
| MiVoice Business | SIP trunk through MiVoice Border Gateway (MBG) | Interop certification in preparation |
| MiVoice 5000 | SIP trunk, through an SBC on public internet links | Interop certification in preparation |
| MiVoice Office 400 | SIP trunk, through an SBC on public internet links | Interop certification in preparation |
| MiContact Center Business | Calls routed through MiVoice Business and its SIP trunk | Supported over standard SIP trunk |
| Mitel cloud deployments (MiCloud Flex, Mitel CX) | Where the platform can route calls to an external SIP URI | Supported over standard SIP trunk |

CallShift is applying to the Mitel Technology Network and preparing SIP trunk interoperability certification. Until it is complete, run the [interoperability test checklist](https://www.callshift.ai/docs/mitel#interoperability-test-checklist) below on your own platform before going live.

## Common deployment patterns

| Pattern | What the agent takes | What to configure on Mitel |
| --- | --- | --- |
| After hours | Calls outside opening hours | Time-of-day routing that sends the night service to the ARS route of the CallShift trunk |
| Overflow | Calls when queues are busy or no agent answers | ACD overflow or interflow to an ARS route pointing at the trunk |
| First-level reception | Every call first, then transfers to the right team | DID routing of the main numbers to the trunk |
| Pilot on a subset | A few sites or DIDs | DID routing of those numbers only |
| Side-by-side test | A share of the calls, next to an existing solution | A split on the Mitel side where your platform supports one, or a split by DID |
| Outbound campaigns | Calls CallShift places through the same trunk | Accept calls from CallShift on the trunk and route them to the PSTN with ARS; see [Outbound campaigns](https://www.callshift.ai/docs/campaigns) |

## Prerequisites

- **On the Mitel side**: SIP trunk licences for the calls the agent takes at once, and a MiVoice Border Gateway or SBC reachable from the internet. On public internet links, TLS signalling is recommended.
- **On the network**, as recommendations: G.711 uses about 85 kb/s per call with 20 ms packetization; aim for packet loss under 1% and jitter under 30 ms.
- **On the CallShift side**: an agent (see [Agents and models](https://www.callshift.ai/docs/agents)) and a SIP trunk, created as in [Bring your own SIP trunk](https://www.callshift.ai/docs/sip-trunks) and in step 1 below.

## Step 1 · Create the trunk in CallShift

[`POST /v1/phones/sip`](https://www.callshift.ai/docs/api/phone-numbers#create-sip-phone) creates the trunk and registers its first number, here a DID that Mitel will route to the agent. The values in angle brackets are yours.

```json
{
  "phoneNumber": "+33187654321",
  "name": "mitel-mbg",
  "terminationUri": "<your-mbg-or-sbc-address>",
  "transport": 3,
  "sipUsername": "<mitel-trunk-username>",
  "sipPassword": "<mitel-trunk-password>",
  "requireInboundAuth": true,
  "agentId": "550e8400-e29b-41d4-a716-446655440000"
}
```

| Field | For Mitel |
| --- | --- |
| `phoneNumber` | The DID, in international format, as Mitel will send it as the called number |
| `terminationUri` | Your MBG or SBC: where CallShift sends the calls it places |
| `transport` | `3` for TLS on the calls CallShift sends to Mitel; `1` UDP and `2` TCP also exist |
| `sipUsername`, `sipPassword` | The digest credentials your MBG or SBC expects from CallShift |
| `requireInboundAuth` | `true`: CallShift generates credentials that Mitel must send on the calls it sends to CallShift. You can also turn it on later from the trunks table (*Inbound authentication*). |
| `sipTrunkId` | For each next DID: add it to the same trunk instead of creating a new one |

Then open the trunk from the trunks table at [app.callshift.ai/phone-numbers](https://app.callshift.ai/phone-numbers): the *Connection* section of its panel gives the origination URI (`<your-origination-uri>`, where Mitel sends calls) and, with `requireInboundAuth`, the inbound username and password (`<inbound-username>`, `<inbound-password>`). Without it, inbound calls are matched on the called number only.

> **Calls per second**
>
> The trunk's calls per second are set in the *CPS* column of the trunks table, from 1 to 100 (1 for a new trunk), not in this request: a `callsPerSecond` field sent here is ignored. They pace the calls of your campaigns. See [Bring your own SIP trunk](https://www.callshift.ai/docs/sip-trunks).

## Step 2 · Configure the Mitel side

Whatever the platform, the trunk toward CallShift takes these values. The codec row is a recommendation, not yet confirmed in interoperability testing.

| Setting | Value |
| --- | --- |
| Destination of the calls to the agent | The origination URI, `<your-origination-uri>`, from the *Connection* section |
| TLS toward CallShift | Not confirmed yet: check with us before relying on it (see [Current limitations](https://www.callshift.ai/docs/mitel#current-limitations)) |
| Authentication toward CallShift | Digest, with `<inbound-username>` and `<inbound-password>` when `requireInboundAuth` is on |
| Authentication from CallShift | Digest, with the `sipUsername` and `sipPassword` of step 1 |
| Called number | The DID in international format (`+33187654321`), exactly as registered on the trunk |
| Calling number | The caller's own number: it becomes the call's caller number, and matches the caller to a contact when the agent's prompt uses contact fields |
| Codec (recommended) | G.711: A-law in Europe, µ-law in North America |
| DTMF | No setting needed: the agent does not act on keypad digits |
| Transfers | REFER accepted on the trunk, for cold transfers; calls from CallShift allowed to the transfer numbers, with your own DIDs as calling number, for warm transfers |

Field names change from one Mitel version to the next: the sections below name the objects to configure, and your Mitel version's SIP trunk configuration guide gives the fields.

### MiVoice Business with MiVoice Border Gateway

- **MBG, SIP Trunking**: add a SIP trunk toward CallShift, with the origination URI as the remote end, the credentials above, and TLS where you use it.
- **MiVoice Business, Network Elements**: the MBG, as the element the trunk goes through.
- **SIP Peer Profile**: a profile for CallShift through that network element, with the authentication. Set the codec where your version configures it.
- **Trunk Attributes**: how the digits of the trunk's incoming calls are handled.
- **ARS Routes and Digit Modification**: a route to the trunk, with the called number sent in international format.

### MiVoice 5000

Create a SIP trunk toward the origination URI in the SIP trunk configuration, with the values of the table above, through your SBC on public internet links. Refer to your MiVoice 5000 version's SIP trunk configuration guide for the fields.

### MiVoice Office 400

Add CallShift as a SIP provider in the SIP provider configuration, with the origination URI, the credentials and the codec above. Refer to your MiVoice Office 400 version's SIP trunk configuration guide for the fields.

### MiContact Center Business and Mitel cloud

MiContact Center Business sends calls through MiVoice Business: configure the trunk there, then route ACD overflow or interflow to it (step 3). On MiCloud Flex or Mitel CX, ask your provider to route the chosen calls to the origination URI with the values above.

## Step 3 · Route calls to the agent

- **A DID to the agent**: route the DID registered in step 1 to the ARS route of the CallShift trunk. In CallShift, assign the agent to that number ([`PATCH /v1/phones/{phoneId}`](https://www.callshift.ai/docs/api/phone-numbers#update-phone)).
- **Overflow from a queue**: set the ACD overflow or interflow of the path to an ARS route pointing at the trunk, with the DID as the dialled number.
- **After hours**: time-of-day routing that sends the night service to the same route.

> **Keep a fallback route**
>
> Give the ARS route a second choice to a human queue or to voicemail, so that calls still land if the trunk to CallShift cannot be reached.

## Step 4 · Transfers back to Mitel

The agent hands the caller over with a `forwardCall` node of its call flow (see [Call flow](https://www.callshift.ai/docs/call-flow)). Its number is either fixed in the node, a variable per entity such as `{{variable.receptionPhone}}`, or looked up by your service during the call: see [Look up the number during the call](https://www.callshift.ai/docs/call-flow#look-up-the-number-during-the-call) and the [dynamic transfer video](https://www.youtube.com/watch?v=_kheLoihMWw).

- **Numbers only.** A transfer goes to a phone number in international format. A bare internal extension such as `2001` is refused: give the number of a DID that reaches the extension or the ACD path's pilot, and let Digit Modification bring it to its target. A PSTN number works the same way.
- **A variable** must hold a number too: when its value for the call's entity is an extension, the transfer is left out of the call.
- **Looked-up numbers** must be in the country of the line the call is on.
- **Cold transfer** is a SIP REFER to Mitel, with `Refer-To: tel:+<number>`. The caller hears a dial tone while Mitel places the call to the number, and CallShift leaves the call.
- **Warm transfer**: CallShift calls the person through the trunk, to your MBG or SBC, with the DID the caller dialled as the calling number. The caller hears hold music while the agent briefs the person, then the two are connected. They stay connected through CallShift until one hangs up, so the call takes two trunk channels.
- **When the transfer does not go through**, the agent tells the caller and carries on the call: on a cold transfer, when Mitel refuses the REFER or reports the number busy or unanswered; on a warm transfer, when the person declines or does not answer within `transferTimeout`, with the `fallbackMessage` if you wrote one.
- On a SIP trunk, cold and warm transfers work on every agent. A looked-up number needs an agent on the current voice engine: see [Call flow](https://www.callshift.ai/docs/call-flow).
- **On the Mitel side**, accept REFER on the trunk, route the number of a REFER in international format, and allow calls from CallShift to the transfer numbers with your DIDs as calling number, as in step 2.

> **Avoid loops**
>
> Never transfer to a DID that routes back to the agent, directly or through an overflow: the caller would come back to the agent. Transfer to a DID that rings people.

## Step 5 · Pass call context

**Inbound**, the context is the called number. Each DID is a number in CallShift, with its agent and its entity: route one DID per site, per service or per language. The call takes the agent's entity, or the number's when the agent is shared, and the agent gets that entity's [variables](https://www.callshift.ai/docs/variables). The calling number matches the caller to a contact when the agent's prompt uses contact fields.

**After the call**, the [after-call webhook](https://www.callshift.ai/docs/webhooks) posts the summary, the outcome and the fields the agent collected to your CRM, your agent desktop or your integration platform. Its `callId` gives the call's page, `https://app.callshift.ai/calls/<callId>`, with the transcript and the recording.

CallShift neither reads custom SIP headers on inbound calls nor adds any on transfers: see [Current limitations](https://www.callshift.ai/docs/mitel#current-limitations).

## Multi-site networks

One shared agent serves every site: one [entity](https://www.callshift.ai/docs/entities) per site, with its own variables (opening hours, transfer numbers, messages), and each site's DID registered on the trunk and placed in its entity. Mitel routes each site's DIDs to the trunk. The [roll-out video](https://www.youtube.com/watch?v=PIvUbiK1CAc) shows a network going live.

## Resilience

- **On the Mitel side**: the fallback route of step 3, and a no-answer timer on the overflow, take the calls the agent cannot.
- **On the CallShift side**: a call to a number with no agent, or on an account with no active subscription or credit left, is not answered by an agent. During a call, an agent does not switch to another model or voice provider if one fails.
- **Before going live**: make the trunk unreachable on purpose and check that calls take the fallback route.

## Security and data

- CallShift is GDPR compliant and ISO 27001 certified.
- Encryption in transit: TLS signalling on the calls CallShift sends to Mitel, with `transport` `3`. CallShift does not turn on SRTP media encryption on the trunks it creates, and TLS toward CallShift is not confirmed yet.
- Customer data is not used to train AI models, and the providers that process it are contractually barred from doing so: see the [privacy policy](https://www.callshift.ai/privacy-policy).

## Interoperability test checklist

Run it on your platform before going live; we use the same list for Mitel certification.

| Test | Expected result | Status |
| --- | --- | --- |
| Inbound call from the PSTN through Mitel | The agent of the DID answers |  |
| Inbound call from an internal extension | The agent answers |  |
| Caller ID preserved | The caller's number is the call's caller number in CallShift |  |
| DTMF (RFC 2833) | Not used by the agent yet |  |
| Hold and retrieve | The call resumes with audio both ways |  |
| Cold transfer to an extension | Mitel accepts the REFER and the extension rings, through its DID |  |
| Cold transfer to an ACD path | The call joins the path's queue |  |
| Cold transfer to a PSTN number | The number rings |  |
| Warm transfer | The person is called through the trunk, briefed, then connected to the caller |  |
| Transfer when the target does not answer | The agent tells the caller and carries on the call |  |
| TLS signalling | Calls set up over TLS in both directions |  |
| SRTP media | Not turned on by CallShift yet |  |
| Custom header received | Not supported yet |  |
| Header sent on transfer | Not supported yet |  |
| Trunk unreachable | Calls take the Mitel fallback route |  |
| Concurrent calls up to the trunk limit | Every call is answered |  |

## Troubleshooting

| What happens | Why | What to do |
| --- | --- | --- |
| One-way audio or no audio | NAT, or the SDP announces a private address | Check the media settings of MBG or the SBC, and the public address it announces |
| `401`, `403` or `407` on the INVITE | Credentials missing or wrong | Toward CallShift, the inbound credentials of the *Connection* section when `requireInboundAuth` is on; toward Mitel, `sipUsername` and `sipPassword` |
| The transfer fails | Cold: REFER not accepted, or its number not routed in international format. Warm: the call from CallShift refused, for example with a `403` on a calling number the trunk does not allow | Accept REFER and route the number with Digit Modification; allow your DIDs as calling numbers from CallShift |
| The transfer number is refused when you save the call flow | It is an extension, not a number | Give the DID in international format |
| Keypad digits have no effect | The agent does not act on DTMF yet | Ask callers to say their choice |
| The call reaches the wrong agent, or none | The called number differs from the number registered, or the agent is not assigned | Send the DID in international format; check the number's agent at [app.callshift.ai/phone-numbers](https://app.callshift.ai/phone-numbers) |
| Campaign calls start more slowly than expected | The trunk's calls per second pace them | Raise them in the *CPS* column of the trunks table, within what your Mitel trunk accepts |

## Current limitations

| Area | Today | Work around it |
| --- | --- | --- |
| Transfer targets | Phone numbers in international format only, no SIP URI or bare extension | A DID that reaches the extension or ACD path |
| Transfers | Cold: a SIP REFER. Warm: a second call through the trunk, which keeps two channels until the call ends. A looked-up number is not on every agent | Size the trunk licences for warm transfers |
| SIP headers | Custom headers are neither read on inbound calls nor sent on transfers | One DID per site or service; the after-call webhook |
| Inbound authentication | Digest only, off by default; no IP allowlist | Set `requireInboundAuth` |
| Encryption | TLS is set on calls toward Mitel; SRTP is not turned on; TLS toward CallShift is not confirmed | Ask `support@callshift.ai` before relying on TLS toward CallShift |
| Codecs and DTMF | CallShift sets no codec on the trunk; the agent does not act on keypad digits | Offer G.711 and test on your platform; ask callers to say their choice |
| Provider failure | No switch to another model or voice provider during a call |  |
| Calls per second | Set in the dashboard, not through the API | The *CPS* column of the trunks table at [app.callshift.ai/phone-numbers](https://app.callshift.ai/phone-numbers) |

The limits of the whole platform are in [Platform limits](https://www.callshift.ai/docs/limits).

## Next steps

Write to `support@callshift.ai` with your Mitel platform and version, the number of DIDs and the calls you want the agent to take: we help you set up the trunk and run the checklist with you.
