Microsoft Teams Integration
PBX.IM connects to Microsoft Teams using Direct Routing. You expose a Session Border Controller (SBC) domain inside Microsoft, point it at PBX.IM's voice infrastructure, and from then on Teams users can make and receive PSTN calls through your PBX.IM account.
The setup is handled entirely from the integration wizard in PBX.IM. The wizard supports two strategies for the SBC domain:
- Managed subdomain — let PBX.IM host and manage DNS on a shared root domain such as
pbx.im. Fastest to set up. - Custom domain — bring your own domain (e.g.,
sbc.acme.com) and add a single CNAME record that points at PBX.IM.
Table of Contents
- Before You Start
- Open the Integration Wizard
- Step 1 — Setup (name and domain strategy)
- Step 2A — Add Domain (managed subdomain only)
- Step 2/3 — Voice Routing in Teams Admin
- Final Step — Review and Save
- Manage Existing Integrations
- Microsoft Teams Integration FAQ
Before You Start
You need:
- Microsoft 365 Global Admin access to your tenant — you'll be working in both
admin.cloud.microsoft(domain ownership) andadmin.teams.microsoft.com(Direct Routing). - A Teams Phone license assigned to the users who will be making and receiving calls.
- For the Custom domain strategy, access to the DNS provider of the domain you plan to use (Cloudflare, Route 53, Google Domains, etc.).
Open the Integration Wizard
In PBX.IM, go to Settings → General → Integrations.
In the Microsoft Teams card, click Add Integration (or Add Another if one already exists). The Add Microsoft Teams wizard opens.
Step 1 — Setup (name and domain strategy)
Integration Name
Give the integration a recognizable name (e.g., Acme Production, EU Region). It's an internal label; it does not appear to call participants.
Choose a Domain Strategy
Pick one of:
Managed subdomain
PBX.IM manages DNS for you on a shared root such as pbx.im. You only need to verify domain ownership in Microsoft.
When you select Managed subdomain, you will see:
- Region — pick the geographic region where the SBC should be hosted. Lower latency for users in that region.
- Domain suffix — only shown if you already have one managed integration; lets you append a numeric suffix so each integration gets a unique subdomain.
The resulting subdomain looks like t-<tenant>.<region>.pbx.im and is displayed throughout the wizard.
Custom domain
Bring your own domain. Fill in:
- SBC Domain — the FQDN your PBX and Teams will both use (e.g.,
sbc.acme.com).
As soon as you blur out of the field, PBX.IM probes your DNS to detect your provider (Cloudflare, Route 53, GoDaddy, Namecheap, etc.) and shows the target host you need to point a CNAME record at.
A DNS Record table is shown with the exact record to create:
| Type | Name | Value |
|---|---|---|
| CNAME | (your subdomain) | (target host from PBX.IM) |
Create the record in your DNS provider's dashboard. PBX.IM offers a one-click Add Record button that opens the detected provider's dashboard in a new tab.
Once the record is added, click Check DNS to verify. The badge flips to DNS Record verified when PBX.IM can resolve the CNAME. DNS propagation can take a few minutes — if the check fails, wait and retry.
Click Next to continue.
Step 2A — Add Domain (managed subdomain only)
This step is only shown when you chose the Managed subdomain strategy — Microsoft requires you to register the FQDN as a domain on your M365 tenant before Teams will accept it.
The wizard renders the exact click-by-click instructions inside the dialog, including the FQDN you must paste. Summary:
- Open admin.cloud.microsoft in a new tab.
- In the sidebar go to Settings → Domains.
- Click Add Domain.
- Paste the FQDN shown in the PBX.IM wizard (e.g.,
t-acme.eu.pbx.im) into the Domain Name field and click Use this domain. - On the verification step click More options → Add a TXT record to the domain's DNS records → Continue.
- Microsoft displays a TXT Value like
MS=ms12345678. Copy it. - Paste it into the TXT Value field back in the PBX.IM wizard and click Add TXT Record. PBX.IM publishes the TXT record on the managed DNS for you. A green confirmation TXT record added appears.
- Go back to the Microsoft tab and click Verify at the bottom.
- Once Microsoft confirms verification, return to PBX.IM and click Next.
Step 2/3 — Voice Routing in Teams Admin
This is the same step in both flows (it is step 2 for custom domain, step 3 for managed). You add the SBC FQDN to Teams as a Direct Routing trunk.
The step has two tabs — pick whichever matches how your team manages Teams:
- Microsoft 365 — the click-by-click walkthrough in the Teams admin web UI. Best for one-off setups.
- PowerShell CLI — the same configuration as ready-to-run cmdlets. Best if you script your Teams tenant or want to apply the same trunk across many users at once.
Microsoft 365 tab (web UI)
- Open admin.teams.microsoft.com.
- In the sidebar navigate to Voice → Direct Routing.
- In the SBCs tab click Add at the top of the table.
- Paste the FQDN shown in the PBX.IM wizard into the Add an FQDN for the SBC field.
- Set SIP Signaling Port to 5061.
- Click Save.
- Once Microsoft saves the SBC, return to PBX.IM and click Next.
PowerShell CLI tab
The wizard pre-fills these commands with your SBC FQDN. Open an elevated PowerShell session, run Connect-MicrosoftTeams, then run the commands in order:
- Register PBX.IM's managed SBC as a Teams PSTN gateway —
New-CsOnlinePSTNGateway. - Create a PSTN usage record and a voice route —
Set-CsOnlinePstnUsagefollowed byNew-CsOnlineVoiceRoute. - Build a voice routing policy —
New-CsOnlineVoiceRoutingPolicy. - Apply the policy to a user and assign their DID —
Grant-CsOnlineVoiceRoutingPolicyandSet-CsPhoneNumberAssignment. - Verify —
Get-CsOnlinePSTNGatewayandGet-CsOnlineUsershould show the trunk and the user'sOnlineVoiceRoutingPolicy.
Each command has a copy button in the wizard so you can paste it directly into PowerShell. The signaling port baked into the cmdlet is 5067 for the managed cmdlet flow; the web UI flow uses 5061.
Final Step — Review and Save
The Review screen summarizes:
| Field | Value |
|---|---|
| Integration name | The name you entered |
| SBC Domain | The FQDN |
| Domain Type | Managed subdomain or Custom domain |
| Region | Only shown for managed integrations |
Click Save to commit the integration. PBX.IM provisions the trunk on its side; from this point Teams users with a Teams Phone license can make and receive PSTN calls through PBX.IM.
You can revisit earlier steps from the stepper at the top at any time before saving.
Manage Existing Integrations
Each saved integration appears as a card on the Integrations tab. The card shows:
- Integration name
- A Microsoft Teams badge
- SBC Domain — the FQDN you registered
- Health Probe — the live status of the trunk. See Health Probe states below.
Each card has two actions:
- Edit — opens the Edit Microsoft Teams dialog (see below).
- Delete — removes the integration. PBX.IM tears down the trunk; you should also delete the corresponding SBC entry from Voice → Direct Routing in Microsoft Teams admin.
You can register more than one integration (for example, one per region). Managed integrations after the first one get a numeric suffix on the subdomain to keep each FQDN unique.
Edit Microsoft Teams Dialog
Clicking Edit on an integration card opens a dialog with two tabs at the top — General and Health. Use Save to commit changes on the General tab; Cancel discards them.
General tab
Read-only fields show what was registered when the integration was created:
| Field | Description |
|---|---|
| SBC Domain | The FQDN registered for this integration. To change it, delete the integration and create a new one |
| Region | The region the integration is currently running in. Auto-detected from call traffic when it differs from the originally chosen region |
Editable fields:
| Field | Description |
|---|---|
| Integration name | Internal label for this integration. Free text |
| Preferred Region | The region you want this integration anchored to. PBX.IM auto-detects regional drift: if more than 60% of calls originate from a different region, the record is automatically moved there |
The Concurrent Calls section shows how many Microsoft Teams channels are provisioned for the integration. Each concurrent call requires one channel. Click Add Channels to purchase additional concurrency.
Health tab
A live read-out of the trunk's reachability. The tab shows:
| Field | Description |
|---|---|
| SBC Domain | The FQDN being probed |
| Health Probe | Current state — see Health Probe states |
| Region | Region currently serving the integration |
| Hubs probe table | One row per PBX.IM SBC hub in the active region with its individual reachability |
| MS inbound probe table | Reachability from each Microsoft inbound IP, so you can see whether the problem is on the PBX.IM side or the Teams side |
If the probe is still in progress, the tab shows a spinner. If it cannot complete (e.g., the SBC is unreachable from PBX.IM at all), it shows Failed to load health status.
Health Probe states
| State | Meaning |
|---|---|
| Checking… | The first probe has not finished yet. Wait a few seconds and refresh |
| Connected | All PBX.IM hubs and Microsoft inbound IPs are reachable. Calls route normally |
| Degraded | At least one hub or Microsoft IP is unreachable, but the trunk is still working overall. Redundancy is reduced — investigate the failing rows in the Health tab before they fail completely |
| Disconnected | The trunk is down. Calls will not route. Recheck the CNAME (custom domain) or the Teams SBC entry, then re-run the probe |
Microsoft Teams Integration FAQ
Managed subdomain vs custom domain — which should I pick?
Managed is faster: PBX.IM handles DNS, and the only thing you do in DNS is a TXT verification record (which PBX.IM publishes for you). Custom domain is the right choice when corporate policy requires the SBC FQDN to live under your own domain.
How long does DNS propagation take for the custom domain CNAME?
Usually a few minutes, but it can take up to a few hours depending on TTL settings. The Check DNS button is safe to retry.
Why does the Sender / SBC card show "Health Probe"?
PBX.IM continuously pings the SBC. Connected means signaling is healthy across every hub and Microsoft inbound IP. Degraded means calls still route but at least one hub or Microsoft IP is unreachable, so redundancy is reduced. Disconnected means the trunk is down — recheck the CNAME (custom domain) or the Teams SBC entry. Open the integration's Edit dialog → Health tab to see exactly which hubs or IPs are failing.
Can I have multiple Teams integrations on one account?
Yes. Each gets its own card. For managed subdomains, second and later integrations get a numeric suffix on the subdomain.
Where do I assign Teams Phone licenses?
In the Microsoft 365 admin center, under Users → Licenses. PBX.IM does not manage Microsoft licensing.
I deleted the integration in PBX.IM but Teams still tries to route calls through it.
Open admin.teams.microsoft.com → Voice → Direct Routing → SBCs and delete the matching FQDN entry on the Microsoft side as well.