Skip to navigation

Microsoft Teams

Redirect Teams calls to your agent and transfer callers back to a Teams number

Redirect calls from a Microsoft Teams Phone auto attendant, call queue, or user to your agent’s number in Vapi for CX, and hand callers back to a Teams number. Direct Routing uses your own session border controller (SBC), the device at the edge of a phone network that accepts SIP calls.

  • Receive calls: Yes, redirected from an auto attendant, call queue, or user.
  • Transfer to a phone number: Yes, to a Teams number.
  • Transfer to a SIP address: Direct Routing only, to your SBC. Microsoft’s SIP protocol documentation describes what the SBC sends on to Teams; your SBC admin must set it to accept the call.
  • Return the call to their system: No.
  • Place calls: Direct Routing only, through your SBC.

Send calls to the agent

Calling Plan and Operator Connect numbers need no extra equipment. Direct Routing numbers also need a voice route to your SBC. Your Teams admin does the steps in Teams.

1

Copy the agent's number

In Vapi for CX, open the agent and choose Connect your phone line, then A contact center. Under Your contact center or phone system, pick Microsoft Teams, and copy the number under In Microsoft Teams, send calls to this number. If the agent has several numbers, pick one under Forward to first. Teams wants it in full international format, starting with + (for example +14155550124).

2

Redirect calls to the agent

In the Teams admin center, do one of these:

  • Auto attendant: Go to Voice › Auto attendants › Add. In the call flow, choose Redirect call › External phone number and enter the agent’s number, or add a menu option whose destination is External phone number. For more information, see Microsoft’s Set up an auto attendant.
  • Call queue: Go to Voice › Call queues. Set the Overflow, Call timeout, and No Agents exceptions to Redirect call › External phone number with the agent’s number. For more information, see Microsoft’s Set up a call queue.
  • One user: Go to Users › Manage users, select the user, then the Voice tab. Under call answering rules, choose Be immediately forwarded and enter the agent’s number. The calling policy setting Call forwarding and simultaneous ringing to external phone numbers must be on (it is by default). For more information, see Microsoft’s user call settings.
3

License the resource account

Each auto attendant or call queue has a resource account, the Teams account that holds its number. In the Microsoft 365 admin center, go to Users › Active users, select the account, then Licenses and Apps, and give it the free Microsoft Teams Phone Resource Account license.

To transfer to outside numbers, Calling Plan numbers also need a funded pay-as-you-go license or Communications credits, and Direct Routing numbers need a voice routing policy (next step). For more information, see Microsoft’s licensing and resource accounts.

4

On Direct Routing, route the agent's number to your SBC

In the Teams admin center, go to Voice › Direct Routing › Voice routes › Add. Add a voice route that uses your SBC, with a number pattern that matches the agent’s number. Give the resource account a custom voice routing policy that uses it. Your SBC admin then sends the agent’s number on over the phone network, or to a Vapi SIP trunk (see Other options). For more information, see Microsoft’s voice routing.

5

Check the line

In Vapi for CX, choose Check the line, then call your Teams number from your own phone. The check passes when your call reaches the agent. Then choose Next: add a handoff.

The number the agent sees is the caller’s own number on auto attendant and call queue transfers from Calling Plan and Operator Connect numbers. On Direct Routing, the number depends on the SBC’s Forward P-Asserted-identity (PAI) header setting. With the setting off (the default), the agent sees the caller’s number. With it on, the agent sees the resource account’s number. For more information, see Microsoft’s limits and supported configurations.

Hand callers to your team

The agent hands the caller to a Teams number without waiting. For how handoffs work, see Handing callers to people.

1

Pick the Teams number

Pick the number that takes the handoff: a user’s number, or the number on a call queue’s or auto attendant’s resource account. It must be a Teams number (Calling Plan, Operator Connect, Direct Routing, or, for a user, Teams Phone Mobile), and not the number that redirects to the agent.

2

Give the queue a number, if it has none

In the Teams admin center, go to Voice › Resource accounts › Add. Fill in Display name and Username, set Resource account type to Call queue (or Auto attendant), and Save. License it in the Microsoft 365 admin center as in License the resource account, above. The license is free, but you must first add it under Billing › Purchase services › Add-ons.

Back in the Teams admin center, select the account, then Assign/unassign › Phone number type › Assigned phone number, and save. Then go to Voice › Call queues › Add › General info › Add an existing resource account. You need a Teams admin role plus User Administrator. Direct Routing numbers with an extension need PowerShell. For more information, see Microsoft’s resource accounts.

3

On Direct Routing, route the number to Teams

Have your SBC admin set the SBC to take the call from Vapi and send the number to Teams. Teams needs a + at the start of the number and the SBC’s name in the Contact header.

4

Add the handoff

In Vapi for CX, on the agent’s Call handling tab, choose Add a handoff on the Handing callers to people card. Say when the agent should use it, choose Transfer to a phone number, and enter the Teams number.

The number your people see is the agent’s number by default, or the caller’s own number if the handoff is set to show it. A Twilio number connected in Vapi for CX passes the caller’s number by default. Teams looks the number up for a name and wants it with a +. On a queue, Microsoft says “representatives see the resource account name or call queue name”.

Check it: Once the handoff is live, choose Check on its row, call the agent from your phone, and ask for a person. The check shows Handoff sent when the agent hands you over.

Transfer to a SIP address on Direct Routing

On Direct Routing, Vapi for CX can send the handoff to your SBC’s address in the form sip:+14155550177@<your SBC's address>. Microsoft’s SIP protocol documentation describes what the SBC must send on to Teams. Your SBC admin must set the SBC to accept the call Vapi passes on and route it there. In Vapi’s dashboard, the trunk needs a gateway with your SBC’s address for calls out.

Limitations

  • Vapi can’t connect to Teams directly. Direct Routing pairs only with a certified SBC, and Microsoft doesn’t support a proxy in between.
  • When the agent’s part ends, the call ends.
  • On a transfer to a phone number, only a spoken summary can travel, and only when the agent’s line is a Twilio number and a person, not a queue or a menu, answers.
  • Each redirected call is a Teams call plus a Vapi call. Vapi bills its minutes, and Microsoft or your carrier bills the phone-network part.
  • Your Vapi subscription sets how many calls can run at once. For more information, see Call concurrency.
  • A Teams call queue holds at most 200 waiting calls, each for up to 45 minutes.

Other options

Your SBC sends the agent’s number straight to a Vapi SIP trunk instead of the phone network. You need a certified SBC, its admin, and a fixed public IPv4 address.

1

Add the trunk

In Vapi’s dashboard, select Integrations, then under Phone Number Providers select SIP Trunk and choose Configure New SIP Trunk, with the SBC’s address as a gateway with Allow inbound calls.

2

Add the agent's number

In Vapi’s dashboard, under Phone Numbers, choose Create Phone Number › BYO SIP Trunk Number for the agent’s number.

3

Pick the number

In Vapi for CX, choose Use a number already in Vapi and pick the number.

4

Send the number to the trunk

Have your SBC admin send that number to sip:<number>@<credential id>.sip.vapi.ai, where <credential id> is the ID of the trunk you added. The SBC must allow Vapi’s addresses.

For addresses and ports, see SIP trunking and Networking and firewall.

Calls out on Direct Routing go through your SBC and carrier. In Vapi’s dashboard, add the SBC to the trunk as a gateway for calls out. The caller ID is the trunk number, and your carrier decides whether to accept it.