Connect your Session Border Controller (SBC) to Direct Routing

This article describes how to configure a Session Border Controller (SBC) and connect it to Phone System Direct Routing. This is step 1 of the following steps to configure Direct Routing:

For information on all the steps required to set up Direct Routing, see Configure Direct Routing.

You can use the Microsoft Teams admin center or PowerShell to configure and connect an SBC to Direct Routing.

Using the Microsoft Teams admin center

  1. In the left navigation, go to Voice > Direct Routing, and then click the SBCs tab.

  2. Click Add.

  3. Enter a FQDN for the SBC.

    Make sure the domain name portion of the FQDN matches a domain that's registered in your tenant and keep in mind that the *.onmicrosoft.com domain name isn't supported for the SBC FQDN domain name. For example, if you have two domain names, contoso.com and contoso.onmicrosoft.com, use sbc.contoso.com as the SBC name. If using a subdomain, make sure this subdomain is also registered in your tenant. For example, if you want to use sbc.service.contoso.com, then service.contoso.com needs to be registered.

  4. Configure the following settings for the SBC, based on your organization's needs. For details on each of these settings, see SBC settings.

    Screenshot of add SBC page in the Microsoft Teams admin center

  5. When you're done, click Save.

Using PowerShell

To connect your SBC to Direct Routing, you'll need to:

  1. Connect to Skype for Business Online by using PowerShell.
  2. Connect the SBC to the tenant.
  3. Verify the SBC connection.

Connect to Skype for Business Online by using PowerShell

You can use a PowerShell session connected to the tenant to pair the SBC to the Direct Routing interface. To open a PowerShell session, follow the steps outlined in Set up your computer for Windows PowerShell.

After you establish a remote PowerShell session, verify that you can see the commands to manage the SBC. To verify the commands, type or copy and paste the following command in the PowerShell session, and then press Enter:

Get-Command *onlinePSTNGateway*

The command returns the four functions shown here that will let you manage the SBC.

CommandType    Name                       Version    Source 
-----------    ----                       -------    ------ 
Function       Get-CsOnlinePSTNGateway    1.0        tmp_v5fiu1no.wxt 
Function       New-CsOnlinePSTNGateway    1.0        tmp_v5fiu1no.wxt 
Function       Remove-CsOnlinePSTNGateway 1.0        tmp_v5fiu1no.wxt 
Function       Set-CsOnlinePSTNGateway    1.0        tmp_v5fiu1no.wxt

Connect the SBC to the tenant

Use the New-CsOnlinePSTNGateway cmdlet to connect the SBC to the tenant. In a PowerShell session, type the following, and then press Enter:

New-CsOnlinePSTNGateway -Fqdn <SBC FQDN> -SipSignalingPort <SBC SIP Port> -MaxConcurrentSessions <Max Concurrent Sessions the SBC can handle> -Enabled $true

Note

  1. We recommend that you set a maximum call limit in the SBC using information that can be found in the SBC documentation. The limit will trigger a notification if the SBC is at the capacity level.
  2. You can only connect the SBC if the domain portion of its FQDN matches one of the domains registered in your tenant, except *.onmicrosoft.com. Using *.onmicrosoft.com domain names is not supported for the SBC FQDN name. For example, if you have two domain names, contoso.com and contoso.onmicrosoft.com, you can use sbc.contoso.com for the SBC name. If you try to connect the SBC with a name such as sbc.contoso.abc, the system won't let you, as the domain is not owned by this tenant.
    In addition to the domain registered in your tenant, it's important that there's a user with that domain and an assigned E3 or E5 license. If not, you'll receive the following error:
    Can not use the "sbc.contoso.com" domain as it was not configured for this tenant.

Here's an example:

New-CsOnlinePSTNGateway -Identity sbc.contoso.com -Enabled $true -SipSignalingPort 5067 -MaxConcurrentSessions 100 

Which returns:

Identity              : sbc.contoso.com 
Fqdn                  : sbc.contoso.com 
SipSignalingPort     : 5067 
FailoverTimeSeconds   : 10 
ForwardCallHistory    : False 
ForwardPai            : False 
SendSipOptions        : True 
MaxConcurrentSessions : 100 
Enabled               : True   

Note

This example shows only the minimum required parameters. There are additional parameters that you can set with the New-CsOnlinePSTNGateway cmdlet during the connection process. To learn more, see SBC settings.

Verify the SBC connection

To verify the connection:

Check whether the SBC is on the list of paired SBCs

After you connect the SBC, use the Get-CsOnlinePSTNGateway cmdlet to verify that the SBC is present in the list of paired SBCs. Type the following in a remote PowerShell session, and then press Enter:

Get-CsOnlinePSTNGateway -Identity sbc.contoso.com  

The paired gateway should appear in the list as shown in the example below, and the Enabled parameter should display a value of True.

Which returns:

Identity              : sbc.contoso.com  
Fqdn                  : sbc.contoso.com
SipSignalingPort     : 5067
CodecPriority         : SILKWB,SILKNB,PCMU,PCMA
ExcludedCodecs        :  
FailoverTimeSeconds   : 10
ForwardCallHistory    : False
ForwardPai            : False
SendSipOptions        : True
MaxConcurrentSessions : 100
Enabled               : True

Validate SIP options

To validate the pairing using outgoing SIP options, use the SBC management interface and confirm that the SBC receives 200 OK responses to its outgoing OPTIONS messages.

When Direct Routing sees incoming OPTIONS, it will start sending outgoing SIP Options messages to the SBC FQDN configured in the Contact header field in the incoming OPTIONS message.

To validate the pairing using incoming SIP options, use the SBC management interface and see that the SBC sends a reply to the OPTIONS messages coming in from Direct Routing and that the response code it sends is 200 OK.

SBC settings

This table lists the options that you can set for the SBC in the Microsoft Teams admin center and by using the New-CsOnlinePSTNGateway cmdlet.

Required? Microsoft Teams admin center setting PowerShell parameter Description Default Possible values Type and restrictions
Yes Add an FQDN for the SBC FQDN None FQDN name, limit 63 characters String, see the list of allowed and disallowed characters on Naming conventions in Active Directory for computers, domains, sites, and OUs
No Enabled Enabled Use to turn on the SBC for outbound calls. You can use this to temporarily remove the SBC from service while it's being updated or during maintenance. False True
False
Boolean
Yes SIP signaling port SipSignalingPort This is the listening port that's used to communicate with Direct Routing by using the Transport Layer (TLS) protocol. None Any port 0 to 65535
No Send SIP options SendSIPOptions Defines whether the SBC will send SIP options messages. We highly recommend that you turn on this setting. When this setting is off, the SBC is excluded from the Monitoring and Alert system. True True
False
Boolean
No Forward call history ForwardCallHistory Indicates whether call history information is forwarded through the trunk. When you turn this on, the Microsoft 365 or Office 365 proxy sends a History-info and Referred-by header. False True
False
Boolean
No Forward P-Asserted-identity (PAI) header ForwardPAI Indicates whether the PAI header is forwarded along with the call. The PAI header provides a way to verify the identity of the caller. If this setting is on, the Privacy:ID header is also sent. False True
False
Boolean
No Concurrent call capacity MaxConcurrentSessions When you set a value, the alerting system will notify you when the number of concurrent sessions is 90 percent or higher than this value. If you don't set a value, alerts aren't generated. However, the monitoring system will report the number of concurrent sessions every 24 hours. Null Null
1 to 100,000
No Failover response codes FailoverResponseCodes
If Direct Routing receives any 4xx or 6xx SIP error code in response to an outgoing Invite, the call is considered completed by default. Outgoing means a call from a Teams client to the PSTN with traffic flow: Teams client -> Direct Routing -> SBC -> telephony network). When you specify a failover response code, this forces Direct Routing to try another SBC (if another SBC exists in the voice routing policy of the user) when it receives the specified codes if the SBC can't make a call because of network or other issues. To learn more, see Failover of specific SIP codes received from the Session Border Controller (SBC). 408, 503, 504 Int
No Failover times (seconds) FailoverTimeSeconds When you set a value, outbound calls that aren't answered by the gateway within the time that you set are routed to the next available trunk. If there are no additional trunks, the call is automatically dropped. The default value is 10 seconds. In an organization with slow networks and gateway responses, this could potentially result in calls being dropped unnecessarily. 10 Number Int
No Preferred country or region for media traffic MediaRelayRoutingLocationOverride Use to manually set your preferred country or region for media traffic. We recommend that you set this only if the call logs clearly indicate that the default assignment of the datacenter for the media path doesn't use the path closest to the SBC datacenter. By default, Direct Routing assigns a datacenter based on the public IP address of the SBC, and always selects the path closest to the SBC datacenter. However, in some cases, the default path might not be the optimal path. This parameter allows you to manually set the preferred region for media traffic. None Country codes in ISO format
No SBC supports PIDF/LO for emergency calls PidfloSupported Specify whether the SBC supports Presence Information Data Format Location Object (PIDF/LO) for emergency calls.
No - MediaBypass This setting indicates whether the SBC supports media bypass and whether you want to use it for this SBC. None True
False
Boolean

See also

Plan Direct Routing

Configure Direct Routing

Teams PowerShell overview