Topic Last Modified: 2010-10-01

Creates a new static phone route.

Syntax

New-CsStaticRoute -Destination <String> -MatchUri <String> -Port <UInt16> -TLSRoute <SwitchParameter> [-Enabled <$true | $false>] [-MatchOnlyPhoneUri <$true | $false>] [-ReplaceHostInRequestUri <$true | $false>] [-TLSCertIssuer <String>] [-TLSCertSerialNumber <Byte[]>] [-UseDefaultCertificate <$true | $false>]
New-CsStaticRoute -Destination <String> -MatchUri <String> -Port <UInt16> -TCPRoute <SwitchParameter> [-Enabled <$true | $false>] [-MatchOnlyPhoneUri <$true | $false>] [-ReplaceHostInRequestUri <$true | $false>]

Parameters

Parameter Required Type Description

Destination

Required

String

If the route uses Transport Layer Security (TLS) as the transport protocol, then the Destination is the fully qualified domain name (FQDN) of the next hop server. For example: -Destination "atl-proxy-001.litwareinc.com".

If the route uses Transmission Control Protocol (TCP) as the transport protocol, then the Destination is the IP address of the next hop router. For example: -Destination "192.168.0.240".

MatchUri

Required

String

FQDN or domain suffix used to determine if the message is being sent to a user handled by this route. For example, you might use the FQDN "litwareinc.com". This pattern matches any user who has a SIP address that ends with the domain name "litwareinc.com".

To match child domains of a domain, you can use a wildcard value like "*.litwareinc.com". That value matches any domain that ends with the suffix "litwareinc.com". For example: northamerica.litwareinc.com; asia.litwareinc.com; and europe.litwareinc.com.

Enabled

Optional

Boolean

If set to True then the route is enabled, and any messages matching the MatchURI pattern will be routed to the next hop server. If set to False, the route is disabled and will not be used in routing messages. The default value is True.

MatchOnlyPhoneUri

Optional

Boolean

If set to True, only messages addressed to phone Uniform Resource identifiers (URIs) (for example, sip:kenmmyer@litwareinc.com;user=phone) will be matched and, potentially, routed. If set to False (the default value) then all messages will be matched.

Port

Required

Integer

Port number used for SIP routing. For example: -Port 7742.

ReplaceHostInRequestUri

Optional

Boolean

If set to True ($True) then the host portion of a Request-URI will be replaced by the address of the next hop server. If set the False then the Request-URI will be used as-is. The Request-URI represents the URI of the user or service that the request (message) is addressed to. The default value is False.

TCPRoute

Optional

Switch Parameter

Configures TCP as the transport protocol for the new route.

TLSCertIssuer

Optional

String

Name of the certification authority (CA) that issued the certificate to be used in the static route. This parameter is not used if you have configured TCP as the transport protocol.

If you include the TLSCertIssuer parameter then you must also use the TLSCertSerialNumber parameter.

TLSCertSerialNumber

Optional

Byte array

Serial number of the TLS certificate to be used in the static route. Serial numbers must be passed as a byte array; this means you must pass the serial number as an array of two-character values. For example: -TLSCertSerialNumber 0x01, 0xA4, 0xD5, 0x67, 0x89.

This parameter is not used if you have configured TCP as the transport protocol.

If you include the TLSCertSerialNumber parameter then you must also use the TLSCertIssuer parameter.

TLSRoute

Optional

Switch Parameter

Configures TLS as the transport protocol for the new route.

UseDefaultCertificate

Optional

Boolean

Configures the route to use your default Lync Server 2010 certificate as its authentication certificate. If you do not want to use the default certificate then you must specify a different certificate by using the TLSCertIssuer and TLSCertSerialNumber parameters.

To view the default certificate, use the following command:

Get-CsCertificate | Where-Object {$_.Use –eq "urn:certref:Default"}

Detailed Description

When you send a SIP message to someone that message might need to traverse multiple subnets and networks before it is delivered; the path traveled by the message is often referred to as a route. In networking, there are two types of routes: dynamic and static. With dynamic routing, servers use algorithms to determine the next location (the next hop) where the message should be forwarded. With static routing, message paths are predetermined by system administrators. When a message is received by a server, the server checks the message address and then forwards the message to the next hop server that has been preconfigured by an administrator. If configured correctly, static routes help ensure timely, and accurate, delivery of messages, and with minimal overheard placed on servers. The downside to static routes is that messages are not dynamically rerouted in the event of a network failure.

New static routes are created by using the New-CsStaticRoute cmdlet. After a route has been created by using New-CsStaticRoute, you must then add the route to a collection of routing configuration settings by using the Set-CsStaticRoutingConfiguration cmdlet.

Who can run this cmdlet: By default, members of the following groups are authorized to run the New-CsStaticRoute cmdlet locally: RTCUniversalServerAdmins. To return a list of all the role-based access control (RBAC) roles this cmdlet has been assigned to (including any custom RBAC roles you have created yourself), run the following command from the Windows PowerShell prompt:

Get-CsAdminRole | Where-Object {$_.Cmdlets –match "New-CsStaticRoute"}

Input Types

None. New-CsStaticRoute does not accept pipelined input.

Return Types

New-CsStaticRoute creates new instances of the Microsoft.Rtc.Management.WritableConfig.Settings.SipProxy.Route object.

Example

-------------------------- Example 1 ------------------------

Copy Code
$x = New-CsStaticRoute -TCPRoute -Destination "192.168.0.100" -Port 8025 -MatchUri "litwareinc.com" 

Set-CsStaticRoutingConfiguration -Identity global -Route @{Add=$x}

The commands shown in Example 1 create a new static route and then add that route to the global static routing configuration collection. To carry out this task, the first command uses New-CsStaticRoute to create an in-memory-only route that uses TCP as its transport protocol. The route points to the next hop IP address 192.168.0.100, uses port 8025, and matches any URI from the domain litwareinc.com. The resulting route object is stored in a variable named $x.

The second command in the example then adds the new route to the global static routing configuration collection. This is done by calling Set-CsStaticRoutingConfiguration along with the Route parameter. The parameter value @{Add=$x} adds the route object stored in $x to the existing set of routes already in the global collection.

-------------------------- Example 2 ------------------------

Copy Code
$x = New-CsStaticRoute -TLSRoute -Destination "atl-proxy-001.litwareinc.com" -Port 8025 -MatchUri "*.litwareinc.com" -UseDefaultCertificate $True

Set-CsStaticRoutingConfiguration -Identity global -Route @{Add=$x}

Example 2 shows how you can create a new static route that uses TLS as its transport protocol, and then add that route to the global static routing configuration collection. To do this, the first command in the example uses New-CsStaticRoute to create an in-memory-only route that uses TLS as its transport protocol. The route points to the "atl-proxy-001.litwareinc.com" as its destination, uses port 8025, and matches any URI that uses the domain suffix "litwareinc.com". In addition, the new route object, which is stored in a variable named $x, uses the default certificate for authentication purposes (-UseDefaultCertificate $True).

After the route object has been created, the second command in the example then adds the new route to the global static routing configuration collection.

See Also