---
title: "Gets the list of routes matching the target phone number, ordered by priority."
method: POST
path: "/sip:testRoutesWithNumber"
tags: ["NumberRoutingValidation"]
---

# Gets the list of routes matching the target phone number, ordered by priority.

`POST /sip:testRoutesWithNumber`

## Query parameters

- `targetPhoneNumber` string, required
- `api-version` string, required

## Request body

- SipConfiguration — Represents a SIP configuration. When a call is being routed the routes are applied in the same order as in the routes list. A route is matched by its number pattern. Call is then directed into route's first available trunk, based on the order in the route's trunks list. The configuration can be expanded with additional data.
  - `domains` object — Validated Domains. Map key is domain.
  - `trunks` object — SIP trunks for routing calls. Map key is trunk's FQDN (1-249 characters).
  - `routes` TrunkRoute[] — Trunk routes for routing calls.
    - `description` string — Gets or sets description of the route.
    - `name` string, required — Gets or sets name of the route.
    - `numberPattern` string, required — Gets or sets regex number pattern for routing calls. .NET regex format is supported. The regex should match only digits with an optional '+' prefix without spaces. I.e. "^\+[1-9][0-9]{3,23}$".
    - `trunks` string[] — Gets or sets list of SIP trunks for routing calls. Trunks are represented as FQDN.
    - `callerIdOverride` string — Gets or sets caller ID override. This value will override caller ID of outgoing call specified at runtime.

## Response `200`

A list of matching routes

- RoutesForNumber — Represents number routing validation details.
  - `matchingRoutes` TrunkRoute[] — The list of routes whose number patterns are matched by the target number. The routes are displayed and apply in the same order as in SipConfiguration.
    - `description` string — Gets or sets description of the route.
    - `name` string, required — Gets or sets name of the route.
    - `numberPattern` string, required — Gets or sets regex number pattern for routing calls. .NET regex format is supported. The regex should match only digits with an optional '+' prefix without spaces. I.e. "^\+[1-9][0-9]{3,23}$".
    - `trunks` string[] — Gets or sets list of SIP trunks for routing calls. Trunks are represented as FQDN.
    - `callerIdOverride` string — Gets or sets caller ID override. This value will override caller ID of outgoing call specified at runtime.

## Other responses

- `default` — Failure

---

[API](https://skmtc.dev/azure/apis/communication-siprouting.md) · [All operations](https://skmtc.dev/azure/apis/communication-siprouting/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/communication-siprouting/revisions/0805b59eda36/schema)
