Skip to main content
By the end of this guide a Teams user can dial a number that your SBC sends to SmartAlex, and your AI agent answers. Teams Phone does not send calls to an outside SIP service on its own. You connect it with Direct Routing and your own Session Border Controller (SBC): one leg of the SBC faces Microsoft Teams, the other faces SmartAlex, and the connection type is Forward calls.
In the app: Sidebar → Calls → PBX Extensions (/settings/pbx) → Connect a PBX → PBX platform → Microsoft Teams (“Via Session Border Controller”). The tile opens on Forward calls. It starts on TLS, with Media Encryption (SRTP) set to Require, IP Whitelist authentication, and G.711 u-law, A-law and G.722 HD.

What you need first

  • Teams admin access to the Teams admin center, and a Microsoft Teams PowerShell session if you prefer commands.
  • A Teams Phone licence for each user who will dial the AI.
  • An SBC certified for Direct Routing, such as AudioCodes, Ribbon or Oracle, with a public FQDN and a publicly trusted certificate for it. The domain part of that FQDN must be registered in your Microsoft 365 tenant, and *.onmicrosoft.com is not allowed.
  • The SBC’s public IP address, for the IP Whitelist.
  • A SmartAlex agent that is ready to answer, and the number it will answer on in Sidebar → Calls → Numbers (/phone-numbers).
  • Firewall access from the SBC to sip.voice.getsmartalex.com on port 5061 (or 5060). This host has no fixed IP list, so use an FQDN rule.

How it connects

This sequence shows a call from Microsoft Teams through your SBC to SmartAlex.

Create the trunk in SmartAlex

1

Open PBX Extensions

In the sidebar, click Calls, then PBX Extensions (/settings/pbx). Click Connect a PBX.
2

Pick Microsoft Teams

On Add connection, choose PBX platform, then click the Microsoft Teams tile, and the form opens on Forward calls.
The Microsoft Teams tile selected under PBX platform in SmartAlexThe Microsoft Teams tile selected under PBX platform in SmartAlex

Pick Microsoft Teams ("Via Session Border Controller").

3

Fill in the form

Use the table below. Type your SBC’s FQDN into PBX SIP Domain and its public IP into PBX IP Address(es).
4

Create the trunk

Click Create SIP Trunk. The app says “SIP trunk created. Configure your PBX with these details.” and lists SIP Server, Port, Transport, Encryption, Codecs, DTMF, Username and Password. Copy the password now, because it is not shown again.

Set up the SBC

The SBC is your own and its menus depend on its maker, so follow your SBC vendor’s Direct Routing guide for where each setting lives. The values are these.
The certificate on SmartAlex’s port 5061 is issued for our SIP provider’s hostname, not sip.voice.getsmartalex.com. If your SBC validates the name strictly on the SmartAlex leg, the TLS handshake fails. Relax the name check on that leg only, or use TCP on 5060 for it. Keep full validation on the Teams leg. See Network requirements.

Set up Teams

These steps follow the Teams admin center and Microsoft’s Direct Routing articles on Microsoft Learn, last updated in 2026. Menu names move now and then, so the PowerShell commands are given as well.

Add the SBC

1

Open Direct Routing

In the Teams admin center left navigation, go to Voice > Direct Routing, then select the SBCs tab.
2

Add the SBC

Select Add.
3

Fill in the SBC

Use the table below, then select Save.
The same step in PowerShell:

Route calls to the AI

1

Create a PSTN usage

Under Voice > Direct Routing, select Manage PSTN usage records in the upper-right corner. Select Add, type SmartAlex, then select Apply.
2

Create the voice route

Select the Voice routes tab, then Add. Enter a name such as SmartAlex AI, set the priority, and set the dialed number pattern to match the numbers the AI answers, for example ^\+27115551234$.
3

Enrol the SBC

Under SBCs enrolled (optional), select Add SBCs, pick your SBC, then select Apply.
4

Add the PSTN usage

Under PSTN usage records (optional), select Add PSTN usage, pick SmartAlex, then select Apply. Select Save.
5

Create a voice routing policy

Go to Voice > Voice routing policies and select Add. Name it SmartAlex AI. Under PSTN usage records, select Add PSTN usage, pick SmartAlex, select Apply, then Save.
6

Assign the policy to users

Go to Users, select a user, then Policies. Next to Assigned policies, select Edit. Under Voice routing policy, pick SmartAlex AI and select Save.
7

Give the user a Direct Routing number

Go to Users > Manage users and select the user. Under Account > General information, select Edit. Under Assign phone number, set Phone number type to Direct Routing, enter the user’s number, then select Apply.
The same steps in PowerShell:
If you assign the global (Org-wide default) voice routing policy, every voice-enabled user inherits it. Use a custom policy and assign it only to the users who should dial the AI.

Send the SBC’s calls to SmartAlex

1

Route on the SBC

On the SBC, send calls for those numbers from the Teams leg to the SmartAlex leg.
2

Make sure SmartAlex knows the number

The number must be in Sidebar → Calls → Numbers (/phone-numbers) with an agent assigned. If it lives with your own carrier, email support@getsmartalex.com about adding it.

Check it worked

1

Teams sees the SBC

Run Get-CsOnlinePSTNGateway -Identity sbc.example.com in Teams PowerShell and check Enabled is True. On the SBC, check it receives 200 OK to its SIP OPTIONS.
2

The card shows a status

Under Sidebar → Calls → PBX Extensions, the card for this trunk appears. For what each status means see Connection status.
3

A call reaches the AI

Call the number from a Teams user, then from a mobile phone. Your agent answers.
4

A transfer works

Ask the agent to put you through to a person. The call lands on the extension or number in its directory.

Next

Fill the extension directory

So the AI can put callers through to your team.

Test before go-live

The full test plan.

Questions people ask

No. Direct Routing always runs through an SBC. Without one, forward a Teams number to a SmartAlex number instead. See Number forwarding.
Teams sends SRTP on its own leg, and the tile matches that so audio stays encrypted end to end. If your SBC terminates SRTP and sends plain RTP to SmartAlex, set Media Encryption to Allow or Off.
The AI sends a SIP REFER to the extension or number in its directory. Your SBC must accept REFER on the SmartAlex leg and route it back to Teams.
Check the SmartAlex leg. The SBC’s public IP must be in PBX IP Address(es), and the credentials must match if you use them. The TLS name check must be relaxed.
The domain part of the FQDN must be registered in your Microsoft 365 tenant, and a *.onmicrosoft.com name is not allowed. Use a name such as sbc.example.com on a domain you own and have added to the tenant.

SIP trunk (Forward calls)

Every trunk setting explained.

Security and compliance

TLS, SRTP and authentication.

RingCentral

Another cloud phone system.

Network requirements

Ports and the change request.
Last modified on November 27, 2026