用于直接路由的本地媒体优化Local Media Optimization for Direct Routing

公共交换式电话网络(PSTN)语音被视为具有对语音质量的高期望值的业务关键型应用程序。Public Switched Telephone Network (PSTN) voice is considered a business-critical application with high expectations for voice quality. 直接路由允许你控制媒体流量流,以适应全球各地的各种企业的多种网络拓扑和本地电话设置。Direct Routing lets you control media traffic flows to accommodate a multitude of network topologies and local telephony setups for various enterprises all over the world.

直接路由的本地媒体优化允许你通过以下方式管理语音质量:Local Media Optimization for Direct Routing lets you manage voice quality by:

  • 控制团队客户端和客户会话边界控制器(SBCs)之间媒体通信流的方式。Controlling how media traffic flows between the Teams clients and the customer Session Border Controllers (SBCs).
  • 在企业网络子网的边界内保持媒体的本地。Keeping media local within the boundaries of corporate network subnets.
  • 允许团队客户端和 SBCs 之间的媒体流,即使 SBCs 位于具有专用 Ip 的企业防火墙之后,也不会直接显示到 Microsoft。Allowing media streams between the Teams clients and the SBCs even if the SBCs are behind corporate firewalls with private IPs and not visible to Microsoft directly.

本地媒体优化支持两种方案:Local Media Optimization supports two scenarios:

  • 通过将集中的 SBC 连接到主会话启动协议(SIP)主干来集中所有本地中继,并将电话服务提供给公司的所有本地分支机构。Centralization of all local trunks through a centralized SBC connected to the main Session Initiation Protocol (SIP)trunk--providing telephony services to all local branch offices of the company.

  • 构建虚拟网络拓扑(SBCs),其中,本地分支机构中的 SBCs 连接到与 Microsoft Phone 系统通过其外部 IP 地址可见并进行通信的集中式代理 SBC。Building a virtual network topology of SBCs--where the SBCs in the local branch offices are connected to a centralized proxy SBC that is visible to, and communicating with, Microsoft Phone System through its external IP address. 在虚拟网络拓扑中,下游 SBCs 通过内部 Ip 进行通信,并且不能直接显示在手机系统中。In a virtual network topology, downstream SBCs are communicating through internal IPs and are not directly visible to Phone System.

本文介绍功能功能以及客户方案和解决方案。This article describes feature functionality, and customer scenarios and solutions. 有关配置的详细信息,请参阅配置本地媒体优化For details on configuration, see Configure Local Media Optimization.

备注

如果想要在 intranet 边界内保留媒体本地,建议使用本地媒体优化。If you want to keep media local within the boundaries of your intranet, Local Media Optimization is recommended. 如果你已有媒体旁路,并且仅使用 SBCs 的公共 IP 地址,则不需要移动到本地媒体优化。If you already have Media Bypass and you use only the public IP addresses of your SBCs, it is not mandatory to move to Local Media Optimization. 您可以继续使用 "媒体绕过"。You can continue to use Media Bypass. 有关详细信息,请参阅规划媒体绕过For more information, see Plan Media Bypass.

支持的客户方案Supported customer scenarios

对于本次讨论,假设 Contoso 在全球范围内运行多个企业,如下所示。For this discussion, assume that Contoso runs multiple businesses across the globe as follows. (请注意,欧洲和 APAC 区域仅用作示例。(Note that Europe and APAC regions are used as examples only. 公司可能有多个具有类似要求的不同区域。)A company might have several different regions with similar requirements.)

  • 在欧洲,Contoso 拥有大约30个国家/地区的办事处。In Europe, Contoso has offices in approximately 30 countries. 每个 office 都有其自己的专用分支交换(PBX)。Each office has its own Private Branch Exchange (PBX).

    Contoso 已提供一个选项,可用于将中继集中在一个位置--对于所有30个欧洲办事处,都是阿姆斯特丹。Contoso was offered an option to centralize the trunks in one location--Amsterdam--for all 30 European offices. Contoso 在阿姆斯特丹中部署了 SBC,提供了足够的带宽以通过中央位置运行呼叫,将中心 SIP 主干连接到集中的位置,并开始从阿姆斯特丹开始为所有欧洲地区提供服务。Contoso deployed the SBC in Amsterdam, provided enough bandwidth to run calls through the centralized location, connected a central SIP trunk to the centralized location, and started serving all European locations from Amsterdam.

  • 在 APAC 地区,Contoso 在不同的国家/地区有多个办事处。In the APAC region, Contoso has multiple offices in different countries.

    在许多国家,公司在本地分支机构中仍然有时间分段多路复用(TDM)中继。In many countries, the company still has time-division multiplexing (TDM) trunks in local branch offices. TDM 中继的集中化不是 APAC 地区的一个选项,因此无法切换到 SIP。Centralization of the TDM trunks is not an option in the APAC region, so switching to SIP is not possible. 50假设在 APAC 地区有数百个具有数百个网关(SBCs)的 Contoso 分支机构。Assume there are more than fifty Contoso branch offices across the APAC region with hundreds of gateways (SBCs). 在这种情况下,不能将所有网关与直接路由接口配对,因为缺少公共 IP 地址和/或本地 internet breakouts。In this scenario, it is not possible to pair all gateways to the Direct Routing interface because of a lack of public IP addresses and/or local internet breakouts. 此外,某些国家/地区强加了无法在没有本地 PSTN 网络连接的情况下满足的法规要求。In addition, some countries impose regulatory requirements that cannot be fulfilled without having local PSTN network connectivity.

根据业务需求,Contoso 实施了两个解决方案,其中包含用于直接路由的本地媒体优化:Based on their business requirements, Contoso implemented two solutions with Local Media Optimization for Direct Routing:

  • 在欧洲,所有中继都是集中式的,并且在中心 SBC 和用户之间基于用户位置进行媒体流。In Europe, all trunks are centralized and media flows between the central SBC and the users, based on the user location.

    • 如果用户连接到企业网络的本地子网(即,用户是内部的用户),则媒体在中央 SBC 和用户的团队客户端的内部 IP 之间流动。If a user is connected to the local subnet of a corporate network (that is, the user is internal), media flows between the internal IP of the central SBC and the user’s Teams client.

    • 如果用户在企业网络边界之外(例如,如果用户使用公共无线互联网连接),则认为该用户是外部用户。If a user is outside the boundaries of the corporate network--for example, if the user is using a public wireless Internet connection--then the user is considered to be external. 在这种情况下,媒体将在中央 SBC 和团队客户端的外部 IP 之间流动。In this case, the media flows between the external IP of the central SBC and the Teams client.

  • 在 APAC 区域中,集中的代理 SBC 与 Microsoft Direct 路由进行了配对,后者定向直接路由接口和本地分支机构中的下游 SBCs 之间的媒体。In the APAC region, a centralized proxy SBC is paired to Microsoft Direct Routing, which directs media between the Direct Routing interface and the downstream SBCs in local branch offices.

    本地分支办公室中的下游 SBCs 在 APAC 中不直接以直接路由的方式显示,但它们通过使用 CSOnlinePSTNGateway cmdlet 在 Microsoft Phone 系统中创建虚拟网络拓扑进行配对。The downstream SBCs in the local branch offices are not directly visible to Direct Routing in APAC, but they are paired by using the Set-CSOnlinePSTNGateway cmdlet to create a virtual network topology within Microsoft Phone System. 如果可能,媒体始终保持本地。Media always stays local when possible. 外部用户在团队客户端与代理 SBC 的公共 IP 之间有媒体流动。External users have media flowing between the Teams client and the public IP of the proxy SBC.

具有集中中继的中心 SBCCentral SBC with centralized trunks

若要构建一个解决方案,其中 PSTN 服务通过单个中心 SBC 和连接的集中 SIP 主干提供给所有本地分支机构,Contoso 租户管理员对服务有一个 SBC (centralsbc.contoso.com);SBC 有一个与之连接的集中 SIP 中继。To build a solution where PSTN services are provided to all local branch offices through a single central SBC with a connected centralized SIP trunk, the Contoso tenant administrator pairs one SBC (centralsbc.contoso.com) to the service; the SBC has a centralized SIP trunk connected to it.

  • 当用户在公司内部网络中时,SBC 为媒体提供 SBC 的内部 IP。When a user is in the internal network of the company, the SBC provides the internal IP of the SBC for media.

  • 当用户在公司网络外部时,SBC 提供 SBC 的外部(公共) IP。When a user is outside of the corporate network, the SBC provides the external (public) IP of the SBC.

注意:仅显示示例、表或图表中的所有值以供演示之用。Note: All values within examples, tables, or diagrams are presented for illustration purposes only.

表 1.Table 1. SBCs 的网络参数示例Example network parameters for SBCs

位置Location SBC FQDNSBC FQDN 内部子网Internal subnet 外部 NAT (受信任的 IP)External NAT (Trusted IP) SBC 外部 IP 地址SBC external IP address SBC 内部 IP 地址SBC internal IP address
阿姆斯特丹Amsterdam centralsbc.contoso.comcentralsbc.contoso.com 192.168.5.0/24192.168.5.0/24 172.16.76.73172.16.76.73 172.16.76.71172.16.76.71 192.168.5.5192.168.5.5
德国Germany 未部署Not deployed 192.168.6.0/24192.168.6.0/24 172.16.76.74172.16.76.74 未部署Not deployed 未部署Not deployed
法国France 未部署Not deployed 192.168.7.0/24192.168.7.0/24 172.16.76.75172.16.76.75 未部署Not deployed 未部署Not deployed

内部用户Internal user

下图显示了当用户连接到用户的家庭分支机构或网站中的企业网络时的通信流。The following diagram shows the traffic flow when a user is connected to the corporate network in the user’s home branch office or site.

在本地时,用户分配给德国的本地分支机构。While on premises, the user is assigned to the local branch office in Germany. 用户通过团队进行直接路由通话。The user makes a Direct Routing phone call through Teams.

  • 用户的团队客户端通过 REST API 直接与电话系统通信,但在呼叫过程中生成的媒体将流入中央 SBC 的内部 IP 地址。The user’s Teams client communicates to Phone System directly through the REST API, but the media generated during the call flows to the central SBC’s internal IP address.

  • SBC 将流量重定向到电话系统和连接的 PSTN 网络。The SBC redirects the flow to Phone System and the connected PSTN network.

  • 中心 SBC 仅通过外部 IP 地址向电话系统显示。The central SBC is visible to Phone System through the external IP address only.

图1。Diagram 1. 当用户使用集中的 SBC 和连接的集中式 SIP 主干时,在 "家庭" 网站中的通信流Traffic flow when the user is in the ‘home’ site with a centralized SBC and with a connected centralized SIP Trunk

![显示通信流本地媒体优化的图表](media/direct-routing-media-op-1.png "当用户在 "home" 站点中时,如果使用集中的 SBC 和连接的集中 SIP 主干,则通信流")Diagram showing traffic flow Local Media Optimization

外部用户External user

下图显示了用户不在本地且未连接到企业网络(即用户的设备通过移动设备或公共 Wi-fi 连接到 Internet)时的通信流。The following diagram shows the traffic flow when a user is not on premises and is not connected to the corporate network (that is, the user’s device is connected to the Internet through a mobile device or public Wi-Fi). 用户通过团队进行直接路由通话:The user makes a Direct Routing phone call through Teams:

  • 用户的团队客户端通过 REST API 直接与电话系统通信,但在这种情况下,在呼叫过程中生成的媒体将流入中央 SBC 的外部 IP 地址。The user’s Teams client communicates to Phone System directly through the REST API, but, in this case, the media generated during the call flows to the central SBC’s external IP address.

  • SBC 将流量重定向到电话系统和连接的 PSTN 网络。The SBC redirects the flow to Phone System and the connected PSTN network.

  • 中心 SBC 仅通过外部 IP 地址向电话系统显示。The central SBC is visible to Phone System through the external IP address only.

在这种情况下,该行为类似于用户是否属于德国的分支机构或任何其他分支机构。In this case, the behavior is similar whether the user is local to the branch office in Germany or to any other branch office. 用户被视为外部用户,因为用户在企业网络的边界之外。The user is considered external because the user is outside the boundaries of the corporate network.

图2。Diagram 2. 当用户使用集中的 SBC 和连接的集中式 SIP 主干时的通信流Traffic flow when the user is external with a centralized SBC and with a connected centralized SIP Trunk

显示通信流本地媒体优化的图表Diagram showing traffic flow Local Media Optimization

具有连接的下游 SBCs 的代理 SBCProxy SBC with connected downstream SBCs

若要构建一个解决方案,其中 PSTN 服务在 APAC 区域中的所有本地分支机构中均提供,其中,TDM 中继的集中不是一个选项,Contoso 管理员对直接路由服务有一个 SBC (proxysbc.contoso.com),也称为代理 SBC。To build a solution where PSTN services are provided in all local branch offices in the APAC region where centralization of the TDM trunks is not an option, the Contoso administrator pairs one SBC (proxysbc.contoso.com), also called the proxy SBC, to the Direct Routing service.

之后,Contoso 管理员添加了一些下游的 SBCs,指示可以通过代理 SBC proxysbc.contoso.com 访问它们。Afterwards, the Contoso administrator adds some downstream SBCs indicating that they can be reached through the proxy SBC proxysbc.contoso.com. 下游 SBCs 不具有公共 Ip,但可以将它们分配给语音路由。Downstream SBCs do not have public IPs, however, they can be assigned to voice routes. 下表显示了示例网络参数和配置。The table below shows example network parameters and configuration.

当用户位于下游 SBC 所在的本地分支机构中时,媒体流量将直接在用户和本地下游 SBC 之间流动。When a user is in the local branch office where the downstream SBC is located, the media traffic flows between the user and the local downstream SBC directly. 如果用户在 office 外部(在公共 internet 上),媒体将从用户流向代理 SBC 的公共 IP,并将其代理到相关的下游 SBC。If a user is outside of the office (on a public internet), the media flows from the user to the public IP of the Proxy SBC, which proxies it to the relevant downstream SBC(s).

表 2.Table 2. SBC 网络信息示例Example SBC network information

位置Location SBC FQDNSBC FQDN 内部子网Internal subnet 外部 NAT (受信任的 IP)External NAT (Trusted IP) SBC 外部 IP 地址SBC external IP address SBC 内部 IP 地址SBC internal IP address
越南Vietnam VNsbc.contoso.comVNsbc.contoso.com 192.168.1.0/24192.168.1.0/24 172.16.240.110172.16.240.110 None 192.168.1.5192.168.1.5
印度尼西亚Indonesia IDsbc.contoso.comIDsbc.contoso.com 192.168.2.0/24192.168.2.0/24 172.16.240.120172.16.240.120 None 192.168.2.5192.168.2.5
新加坡Singapore proxysbc.contoso.comproxysbc.contoso.com 192.168.3.0/24192.168.3.0/24 172.16.240.130172.16.240.130 172.16.240.133172.16.240.133 192.168.3.5192.168.3.5

内部用户Internal user

下图显示了当用户位于 APAC 区域中的 office 内部时,该方案的高级流量流。The following diagram shows the high-level traffic flow for the scenario when a user is inside the office in the APAC region. 分配给越南的本地分支机构且在本地的用户通过团队直接路由电话呼叫。The user, who is assigned to a local branch office in Vietnam, and is on premises, makes a Direct Routing phone call through Teams.

  • 用户的团队客户端通过 REST API 直接与电话系统通信,但在呼叫过程中生成的媒体将流入本地 SBC 的内部 IP 地址。The user’s Teams client communicates with Phone System directly through the REST API, but media generated during the call flows to local SBC’s internal IP address.

  • 本地 SBC 将流重定向到新加坡中的代理 SBC 和连接的本地 PSTN 网络。The local SBC redirects the flow to the proxy SBC in Singapore and to the connected local PSTN network.

  • 代理 SBC 仅通过外部 IP 地址对电话系统可见,并将下游 SBC (本例中为越南的本地 SBC)的流路由到电话系统。The proxy SBC is visible to Phone System through the external IP address only and routes the flow from the downstream SBC (in this case the local SBC in Vietnam) to Phone System.

  • 本地分支机构中的下游 SBC 不会直接显示在手机系统中,而是在由 Contoso 管理员在设置本地媒体优化时定义的虚拟网络拓扑中进行映射。The downstream SBC in the local branch office is not visible to Phone System directly but is mapped within the virtual network topology that is defined by the Contoso administrator while setting up Local Media Optimization.

注意:根据配置的本地媒体优化模式,对本地用户和非本地用户的行为可能有所不同。Note: The behavior might be different for local users and non-local users depending on the configured Local Media Optimization mode.

有关可能的模式和相关行为的详细信息,请参阅配置本地媒体优化。For more information on possible modes and relevant behavior, see Configure Local Media Optimization.

图3。Diagram 3. 当用户使用代理 SBC 和连接的下游 SBCs 的 "家庭" 网络时的通信流Traffic flow when the user is in the “home” network with a proxy SBC and with connected downstream SBCs

![显示通信流本地媒体优化的图表](media/direct-routing-media-op-3.png "当用户在 "家庭" 网络中时,代理 SBC 使用连接的下游 SBCs 的流量流")Diagram showing traffic flow Local Media Optimization

外部用户External user

下图显示了当用户超出公司网络边界时的通信流。The following diagram shows the traffic flow when a user is outside of the corporate network boundaries. 用户不在本地(不在企业网络的边界内)。The user is not on premises (is not within the boundaries of corporate network). 用户通过团队将直接路由电话拨入到越南的电话号码。The user makes a Direct Routing phone call through Teams to a phone number in Vietnam.

  • 用户的团队客户端通过 REST API 直接与电话系统通信,但在呼叫过程中生成的媒体首先排在新加坡的代理 SBC 的外部 IP 地址。The user’s Teams client communicates with Phone System directly through the REST API, but the media generated during the call flows first to the external IP address of the proxy SBC in Singapore.

  • 根据配置和语音策略(有关详细信息,请参阅配置本地媒体优化),代理 SBC 将流重定向到越南的下游 SBC。Based on configuration and voice policies (see Configure Local Media Optimization for details), the proxy SBC redirects the flow to the downstream SBC in Vietnam.

  • 越南中的下游 SBC 将流重定向到连接的本地 PSTN 网络。The downstream SBC in Vietnam redirects the flow to the connected local PSTN network.

  • 代理 SBC 仅通过外部 IP 地址对电话系统可见。The proxy SBC is visible to Phone System through the external IP address only.

  • 本地分支机构中的下游 SBC 不会直接显示在手机系统中,而是在由 Contoso 管理员在设置本地媒体优化时定义的虚拟网络拓扑中进行映射。The downstream SBC in the local branch office is not visible to Phone System directly, but is mapped within the virtual network topology that is defined by the Contoso administrator while setting up Local Media Optimization. 在此示例中,用户被视为外部用户,因为用户在企业网络的边界之外。In the example, the user is considered external because the user is outside the boundaries of the corporate network.

图4。Diagram 4. 当用户使用代理 SBC 和连接的下游 SBCs 时的通信流Traffic flow when the user is external with a proxy SBC and with connected downstream SBCs

显示通信流本地媒体优化的图表Diagram showing traffic flow Local Media Optimization

本地媒体优化模式Local Media Optimization modes

本地媒体优化支持两种模式:Local Media Optimization supports two modes:

  • 模式1:始终绕过Mode 1: Always bypass. 在这种情况下,如果用户是内部用户,则媒体将流经本地下游 SBC 的内部 IP 地址,无论内部用户的实际位置如何;例如,在与下游 SBC 位于同一个分支机构的同一分支机构内或在其他分支机构中。In this case, if the user is internal, the media will flow through the local downstream SBC’s internal IP address regardless of the actual location of the internal user; for example, within the same branch office where the downstream SBC is located or in some other branch office.

  • Mode 2:仅适用于本地用户Mode 2: Only for local users. 在此模式下,仅当内部用户与下游 SBC 位于同一分支机构中时,媒体才会直接流向本地下游 SBC 内部 IP 地址。In this mode, media will flow directly to the local downstream SBC’s internal IP address only when generated by the internal user located in the same branch office as the downstream SBC.

为了区分本地媒体优化模式,租户管理员需要使用 CSonlinePSTNGateway cmdlet 将-BypassMode 参数设置为每个 SBC 的 "Always" 或 "OnlyForLocalUsers"。To distinguish between Local Media Optimization modes, the tenant administrator needs to set the -BypassMode parameter to either ‘Always’ or ‘OnlyForLocalUsers’ for every SBC by using the Set-CSonlinePSTNGateway cmdlet. 有关详细信息,请参阅配置本地媒体优化For more information, see Configure Local Media Optimization.

模式1:始终绕过Mode 1: Always bypass

如果你在分支机构之间有良好的连接,则建议的模式始终为绕过。If you have good connection between branch offices, the recommended mode is Always bypass.

例如,假设公司在阿姆斯特丹中有一个集中 SIP 主干,其中包含30个国家/地区,并且所有30个站点和本地用户之间有良好的连接。For example, assume a company has a centralized SIP trunk in Amsterdam, which serves 30 countries and has good connectivity between all 30 sites and local users. 在德国还有一个分支,本地 SBC 已部署。There is also a branch in Germany where a local SBC is deployed.

德国的 SBC 可以在 "始终绕过" 模式下进行配置。The SBC in Germany can be configured in “Always bypass” mode. 无论用户的位置如何,用户都将直接通过 SBC 的内部 IP 地址(例如从华北到德国)连接到 SBC; 请参阅下图中的参考。Users, regardless of their location, will connect to the SBC directly through the internal IP address of the SBC (for example from France to Germany; see the diagram below for reference).

下面介绍两种方案:The following describes two scenarios:

  • 方案1。Scenario 1. 用户与联机语音路由策略中定义的 SBC 位于同一位置。The user is in the same location as the SBC defined in the Online Voice Routing Policy.

  • 方案2。Scenario 2. 用户和网关位于不同的站点。The user and gateways are in different sites.

方案1。Scenario 1. 用户与联机语音路由策略中定义的 SBC 位于同一位置The user is in the same location as the SBC defined in the Online Voice Routing Policy

将阿姆斯特丹中的 SBC 配置为德国本地下游 SBC 的代理 SBC。The SBC in Amsterdam is configured to be a proxy SBC for a local downstream SBC in Germany. 用户与本地 SBC 的企业网络在同一子网中的德国位于德国。The user is in Germany within the same subnet as the corporate network of the local SBC. SBCs (代理和下游)都配置为始终绕过模式。Both SBCs (proxy and downstream) are configured for Always Bypass mode. 联机语音路由策略指定,在德国通话(带有区号 + 49)的情况下,应将它们路由到德国的本地 SBC。Online voice routing policies specify that in case of calls within Germany (with area code +49) they should be routed to the local SBC in Germany. 所有其他通话--在德国的 SBC 出现故障时,应以阿姆斯特丹的形式将其路由到代理 SBC。All other calls--and in case the SBC in Germany fails, calls in Germany--should be routed to the proxy SBC in Amsterdam. 下表总结了示例配置。The following table summarizes the example configuration.

表3。Table 3. 方案1的示例配置Example configuration for Scenario 1

用户物理位置User physical location 用户拨打号码User makes a call to a number 联机语音路由策略Online Voice Routing Policy 针对 SBC 配置的模式Mode configured for SBC 媒体流Media Flow
德国Germany + 49 1 437 2800+49 1 437 2800 优先级1: ^+49 (\d{8}) $-DEsbc.contoso.comPriority 1: ^+49(\d{8})$ -DEsbc.contoso.com
优先级2:. *-proxysbc.contoso.comPriority 2: .* - proxysbc.contoso.com
DEsbc.contoso.com-始终绕过DEsbc.contoso.com – Always Bypass
proxysbc.contoso.com-始终绕过proxysbc.contoso.com – Always Bypass
团队用户 <-> DEsbc.contoso.comTeams User <–> DEsbc.contoso.com

下图显示了德国内部用户的高级通信流,使您可以通过团队将电话呼叫直接路由到德国的号码。The diagram below shows the high-level traffic flow for the internal user in Germany making a Direct Routing phone call through Teams to the number in Germany.

  • 用户的团队客户端通过 REST API 直接与电话系统通信。The user’s Teams client communicates with Phone System directly through the REST API.

  • 在呼叫过程中生成的媒体将流入本地 SBC 的内部 IP 地址。The media generated during the call flows to the local SBC’s internal IP address.

  • 本地 SBC 将该流重定向到阿姆斯特丹中的代理 SBC 和连接的本地 PSTN 网络。The local SBC redirects the flow to the proxy SBC in Amsterdam and to the connected local PSTN network.

  • 代理 SBC 仅通过外部 IP 地址对电话系统可见,并将下游 SBC (在本例中为德国的本地 SBC)的流路由到电话系统。The proxy SBC is visible to Phone System through the external IP address only and routes the flow from the downstream SBC (in this case, the local SBC in Germany) to Phone System.

  • 本地分支机构中的下游 SBC 不会直接显示在手机系统中,而是在由 Contoso 管理员在设置本地媒体优化时定义的虚拟网络拓扑中进行映射。The downstream SBC in the local branch office is not visible to Phone System directly but is mapped within the virtual network topology that is defined by the Contoso administrator while setting up Local Media Optimization.

图5。Diagram 5. 具有 "始终绕过" 模式且用户位于 "主页" 网站中的流量流Traffic flow with “Always Bypass” mode and the user is in the “home” site

![显示通信流本地媒体优化的图表](media/direct-routing-media-op-5.png "具有 "始终绕过" 模式且用户位于 "开始" 网站中的流量流")Diagram showing traffic flow Local Media Optimization

方案2:用户和网关位于不同的站点Scenario 2: The user and gateways are in different sites

将阿姆斯特丹中的 SBC 配置为德国本地下游 SBC 的代理 SBC。The SBC in Amsterdam is configured to be a proxy SBC for a local downstream SBC in Germany. SBCs (代理和下游)都配置为始终绕过模式。Both SBCs (proxy and downstream) are configured for Always Bypass mode. 法国的内部用户(位于本地分支机构)正在与德国进行直接路由呼叫。The internal user in France, located in the local branch office, is making a Direct Routing call to Germany. 联机语音路由策略指定对德国的通话(带有区号 + 49)应路由到德国的本地 SBC。Online voice routing policies specify that calls to Germany (with area code +49) should be routed to the local SBC in Germany. 所有其他通话--在德国的 SBC 出现故障的情况下,所有通话都应以阿姆斯特丹的形式路由到代理 SBC。All other calls--and, in case the SBC in Germany fails, all calls in Germany--should be routed to the proxy SBC in Amsterdam. 下表总结了示例配置。The following table summarizes the example configuration.

表4。Table 4. 方案2的示例配置Example configuration for Scenario 2

用户物理位置User physical location 用户拨打号码User makes a call to a number 联机语音路由策略Online Voice Routing Policy 针对 SBC 配置的模式Mode configured for SBC 媒体流Media Flow
法国France + 49 1 437 2800+49 1 437 2800 优先级1: ^+49 (\d{8}) $-DEsbc.contoso.comPriority 1: ^+49(\d{8})$ -DEsbc.contoso.com
优先级2:. *-proxysbc.contoso.comPriority 2: .* - proxysbc.contoso.com
DEsbc.contoso.com-始终绕过 proxysbc.contoso.com-始终绕过DEsbc.contoso.com – Always Bypass proxysbc.contoso.com – Always Bypass 团队用户 <-> DEsbc.contoso.comTeams User <– > DEsbc.contoso.com

下图显示了当位于法国的内部德语用户通过团队向德国的电话号码进行直接路由呼叫时的高级别流量流。The following diagram shows the high-level traffic flow when the internal German user located in France makes a Direct Routing phone call through Teams to the number in Germany.

  • 用户的团队客户端通过 REST API 直接与电话系统通信。The user’s Teams client communicates with Phone System directly through the REST API.

  • 在呼叫过程中生成的媒体将直接流过德国内部 IP 地址中的 SBC。The media generated during the call flows directly to the SBC in Germany's internal IP address.

  • 德国的 SBC 将该流重定向到阿姆斯特丹和连接的本地 PSTN 网络的代理 SBC。The SBC in Germany redirects the flow to the proxy SBC in Amsterdam and to the connected local PSTN network.

图6。Diagram 6. 具有 "始终绕过" 模式且用户不在 "家庭" 网站中,但在内部网络中的流量流Traffic flow with “Always Bypass” mode and the user is not in “home” site but in the internal network

![显示通信流本地媒体优化的图表](media/direct-routing-media-op-6.png "具有 "始终绕过" 模式的流量流,并且用户不在 "主页" 网站中,而是在内部网络中")Diagram showing traffic flow Local Media Optimization

Mode 2:仅适用于本地用户Mode 2: Only for local users

如果本地分支机构之间存在不正确的连接,但每个本地分支机构和区域 office 之间连接良好,则推荐模式为 "仅适用于本地用户"。If there are bad connections between local branch offices but good connections between each local branch office and regional office, then the recommended mode is “Only For Local Users”.

例如,在 APAC 区域中,假设 Contoso 拥有不同国家/地区的多个办事处。For example, in the APAC region, assume Contoso has multiple offices in different countries. 对于许多国家/地区,由于公司在许多本地分支机构中仍然有 TDM 中继,因此无法切换到 SIP。For many countries, switching to SIP is not possible because the company still has TDM trunks in many local branch offices. TDM 中继的集中化不是 APAC 地区的一个选项。Centralization of the TDM trunks is not an option in the APAC region. 此外,有数百个网关(SBCs)的 APAC 区域内有超过50个 Contoso 分支机构。Moreover, there are more than fifty Contoso branch offices across the APAC region with hundreds of gateways (SBCs).

若要构建一个解决方案,其中 PSTN 服务在 APAC 区域中的所有本地分支机构中均提供,而你的 TDM 中继的集中不是一个选项,则 Contoso 管理员将一个新加坡的区域 SBC 作为代理 SBC 提供给直接路由服务。To build a solution where PSTN services are provided in all local branch offices in the APAC region where centralization of the TDM trunks is not an option, the Contoso administrator pairs one regional SBC in Singapore as the proxy SBC to the Direct Routing service. 本地分支办公室之间的直接连接不好,但每个本地分支机构和新加坡的区域 SBC 之间存在良好的连接。The direct connection between the local branch offices is not good, but there is a good connection between each local branch office and the regional SBC in Singapore. 对于地区性 SBC,管理员选择 "始终绕过" 模式,对于本地下游 SBCs,管理员选择 "仅用于本地用户" 模式。For the regional SBC, the administrator chooses ‘Always Bypass’ mode, and for the local downstream SBCs, the administrator chooses ‘Only For Local Users’ mode.

下面介绍两种方案:The following describes two scenarios:

  • 方案1。Scenario 1. 用户与联机语音路由策略中定义的 SBC 位于同一位置The user is in the same location as the SBC defined in the Online Voice Routing Policy

  • 方案2。Scenario 2. 用户和网关位于不同的站点The user and gateways are in different sites

方案1。Scenario 1. 用户与联机语音路由策略中定义的 SBC 位于同一位置The user is in the same location as the SBC defined in Online Voice Routing Policy

假定已将新加坡中的 SBC 配置为适用于越南和印度尼西亚本地下游 SBCs 的代理 SBC。Assume the SBC in Singapore is configured to be a proxy SBC for the local downstream SBCs in Vietnam and Indonesia. 用户在与本地 SBC 位于同一位置的越南中。The user is in Vietnam within the same location as the local SBC. 联机语音路由策略指定越南(带区号 + 84)的呼叫应路由到越南的本地 SBC。Online voice routing policies specify that calls in Vietnam (with area code +84) should be routed to the local SBC in Vietnam. 所有其他呼叫-如果越南中的 SBC 失败,则在越南的调用中应路由到新加坡的代理 SBC。All other calls--and, if the SBC in Vietnam fails, calls in Vietnam--should be routed to the proxy SBC in Singapore. 下表总结了示例配置。The following table summarizes the example configuration.

表5。Table 5. "仅适用于本地用户" 模式方案1的示例配置Example configuration for ‘Only For Local Users’ mode Scenario 1

用户物理位置User physical location 用户拨打号码User makes a call to a number 联机语音路由策略Online Voice Routing Policy 针对 SBC 配置的模式Mode configured for SBC 媒体流Media Flow
越南Vietnam + 84 4 3926 3000+84 4 3926 3000 优先级1: ^+84 (\d{9}) $-VNsbc.contoso.comPriority 1: ^+84(\d{9})$ -VNsbc.contoso.com
优先级2:. *-proxysbc.contoso.comPriority 2: .* - proxysbc.contoso.com
VNsbc.contoso.com-仅适用于本地用户VNsbc.contoso.com – Only For Local Users
proxysbc.contoso.com-始终绕过proxysbc.contoso.com – Always Bypass
团队用户 <-> VNsbc.contoso.comTeams User <–> VNsbc.contoso.com

在下图中,分配给越南中的本地分支机构的用户,而在本地,则通过团队直接路由电话呼叫。In the following diagram, a user assigned to the local branch office in Vietnam, while on premises, makes a Direct Routing phone call through Teams.

  • 用户的团队客户端通过 REST API 直接与电话系统通信。The user’s Teams client communicates with Phone System directly through the REST API.

  • 在呼叫过程中生成的媒体将流入本地 SBC 的内部 IP 地址。Media generated during the call flows to the local SBC’s internal IP address.

  • 本地 SBC 将流重定向到新加坡中的代理 SBC 和连接的本地 PSTN 网络。The local SBC redirects the flow to the proxy SBC in Singapore and to the connected local PSTN network.

  • 代理 SBC 仅通过外部 IP 地址对电话系统可见,并将下游 SBC (在本例中为越南中的本地 SBC)的流路由到手机系统。The proxy SBC is visible to Phone System through the external IP address only and routes the flow from the downstream SBC (in this case, the local SBC in Vietnam) to Phone System.

  • 本地分支机构中的下游 SBC 直接不会直接向电话系统显示,但会在虚拟网络拓扑中进行映射。The downstream SBC in the local branch office is not visible to Phone System directly but is mapped within the virtual network topology.

图表7。Diagram 7. 带有 "仅适用于本地用户" 模式的流量和用户位于 "家庭" 网站中的流量Traffic flow with “Only For Local Users” mode and the user is in “home” site

![显示通信流本地媒体优化的图表](media/direct-routing-media-op-7.png "带有 "仅适用于本地用户" 模式的流量和用户处于 "家庭" 网站中的流量")Diagram showing traffic flow Local Media Optimization

方案2。Scenario 2. 用户和网关位于不同的站点The user and gateways are in different sites

假定已将新加坡中的 SBC 配置为适用于越南和印度尼西亚本地下游 SBCs 的代理 SBC。Assume the SBC in Singapore is configured to be a proxy SBC for the local downstream SBCs in Vietnam and Indonesia. 在印度尼西亚的内部用户(位于本地分支机构中)是向越南进行直接路由呼叫。The internal user in Indonesia, located in the local branch office, is making a Direct Routing call to Vietnam. 联机语音路由策略指定对越南(带区号 + 84)的呼叫应路由到越南的本地 SBC。Online Voice routing policies specify that calls to Vietnam (with area code +84) should be routed to the local SBC in Vietnam. 所有其他呼叫(如果越南中的 SBC 失败),应将对越南的调用路由到新加坡的代理 SBC。All other calls--and, in case the SBC in Vietnam fails, calls to Vietnam--should be routed to the proxy SBC in Singapore. 新加坡中的代理 SBC 设置为 "Always Byass" 模式,并且越南中的本地 SBC 为 "仅适用于本地用户" 模式。The proxy SBC in Singapore is set to ‘Always Byass’ mode, and the local SBC in Vietnam is set to ‘Only For Local Users’ mode. 下表总结了示例配置。The following table summarizes the example configuration.

表6。Table 6. 用户配置User configuration

用户物理位置User physical location 用户拨打号码User makes a call to a number 联机语音路由策略Online Voice Routing Policy 针对 SBC 配置的模式Mode configured for SBC 媒体流Media Flow
印度尼西亚Indonesia + 84 4 3926 3000+84 4 3926 3000 优先级1: ^+84 (\d{9}) $-VNsbc.contoso.comPriority 1: ^+84(\d{9})$ -VNsbc.contoso.com
优先级2:. *-proxysbc.contoso.comPriority 2: .* - proxysbc.contoso.com
VNsbc.contoso.com-仅适用于本地用户VNsbc.contoso.com – Only For Local Users
proxysbc.contoso.com-始终绕过proxysbc.contoso.com – Always Bypass
团队用户 < – > proxysbc.contoso.com < – > VNsbc.contoso.comTeams User <–> proxysbc.contoso.com <–> VNsbc.contoso.com

在下图中,内部用户在印度尼西亚语分支机构内部部署中,通过团队将电话直接路由到越南号码。In the following diagram, the internal user, while on premises in the Indonesian branch office, makes a Direct Routing phone call through Teams to a number in Vietnam.

  • 用户的团队客户端通过 REST API 直接与电话系统通信。The user’s Teams client communicates with Phone System directly through the REST API.

  • 在呼叫过程中生成的媒体首先流向代理 SBC 的内部 IP 地址。Media generated during the call flows to proxy SBC’s internal IP address first.

  • 在新加坡中,代理 SBC 将流重定向到越南和手机系统的下游 SBC 的内部 IP 地址。The proxy SBC in Singapore redirects the flow to the internal IP address of the downstream SBC in Vietnam and to Phone System.

  • 越南中的下游 SBC 将流路由到连接的本地 PSTN 网络。The Downstream SBC in Vietnam routes the flow to the connected local PSTN network.

  • 代理 SBC 仅通过外部 IP 地址对电话系统可见。The proxy SBC is visible to Phone System through the external IP address only.

  • 本地分支办公室中的下游 SBCs 直接不会直接向电话系统显示,但会在虚拟网络拓扑中进行映射。The downstream SBCs in local branch offices are not visible to Phone System directly but are mapped within the virtual network topology.

图8。Diagram 8. 带有 "仅用于本地用户" 模式的流量流,并且用户不在 "家庭" 网站中,而在内部网络中Traffic flow with “Only For Local Users” mode, and the user is not in “home” site but in the internal network

![显示通信流本地媒体优化的图表](media/direct-routing-media-op-8.png "带有 "仅针对本地用户" 模式的流量流,用户不在 "主页" 网站中,而是在内部网络中")Diagram showing traffic flow Local Media Optimization