---
title: Map Destination URI to Trunk
slug: dynamic-sip-trunking/map-destination-uri-to-trunk
createdAt: 2026-08-10T10:46:02.332Z
---

Configures where incoming calls should be routed. This is required for **Inbound/Origination** calls - routing calls from the telephone network to your system.

The destination can be an IP address or FQDN (Fully Qualified Domain Name) of your PBX/SBC.

### Important Notes

- **For IP-based destinations:** You MUST whitelist the IP using the "Map ACL to Trunk" API first
- **For FQDN-based destinations:** No whitelisting required (e.g., sip.yourcompany.com)
- The destination format is: \<ip\_or\_fqdn>:\<port>;transport=\<protocol>
- You need to set

### HTTP Request

:::BlockQuote
POST https\://\<your\_api\_key>:\<your\_api\_token>@\<subdomain>/v2/accounts/\<your\_sid>/trunks/\<trunk\_sid>/destination-uris
:::

### Request Headers

| Header       | Value            |
| ------------ | ---------------- |
| Content-Type | application/json |

### Request Parameters

| Parameter Name              | Mandatory/Optional | Value                                                                                                                                                                                                                                          |
| --------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| destinations                | Mandatory          | Array; List of destination objects. Each object contains a destinationfield.                                                                                                                                                                   |
| destinations\[].destination | Mandatory          | String; SIP URI in format \<ip\_or\_fqdn>:\<port>;transport=\<protocol>. Port is typically 5061for TLS or 5060for TCP. Transport can be tls(recommended) or tcp. Example: 44.248.146.11:5061;transport=tls, sip.company.com:5061;transport=tls |

### Example Request (IP-based destination)

**Note:** Ensure the IP 44.248.146.11is whitelisted first using Map ACL API.

:::BlockQuote
curl -s -X POST "https\://\<your\_api\_key>:\<your\_api\_token>@\<subdomain>/v2/accounts/\<your\_sid>/trunks/\<trunk\_sid>/destination-uris" \\
&#x20; -H "Content-Type: application/json" \\
&#x20; -d '\{
&#x20;   "destinations": \[
&#x20;     \{
&#x20;       "destination": "44.248.146.11:5061;transport=tls"
&#x20;     }
&#x20;   ]
&#x20; }'
:::

### Example Request (FQDN-based destination)

:::BlockQuote
curl -s -X POST "https\://\<your\_api\_key>:\<your\_api\_token>@\<subdomain>/v2/accounts/\<your\_sid>/trunks/\<trunk\_sid>/destination-uris" \\
&#x20; -H "Content-Type: application/json" \\
&#x20; -d '\{
&#x20;   "destinations": \[
&#x20;     \{
&#x20;       "destination": "sip.yourcompany.com:5061;transport=tls"
&#x20;     }
&#x20;   ]
&#x20; }'
:::

### HTTP Response

On success, the HTTP response status code will be 200 OKor 207 Multi-Status(for partial success/failure).

The response includes metadatawith counts of successful and failed destinations.

### Example Response (Success)

:::BlockQuote
\{
&#x20; "request\_id": "63999f0a98a24a0aa58ab5b74aec9f0a",
&#x20; "method": "POST",
&#x20; "http\_code": 200,
&#x20; "metadata": \{
&#x20;   "total": 1,
&#x20;   "success": 1,
&#x20;   "failed": 0
&#x20; },
&#x20; "response": \[
&#x20;   \{
&#x20;     "code": 200,
&#x20;     "error\_data": null,
&#x20;     "status": "success",
&#x20;     "data": \{
&#x20;       "id": "2543",
&#x20;       "destination": "sip:44.248.146.11:5061;transport=tls",
&#x20;       "date\_created": "2026-01-23T13:38:32Z",
&#x20;       "date\_updated": "2026-01-23T13:38:32Z",
&#x20;       "type": "public",
&#x20;       "priority": 0,
&#x20;       "weight": 1,
&#x20;       "trunk\_sid": "trmum1f708622631150902801a1n"
&#x20;     }
&#x20;   }
&#x20; ]
}
:::

### Response Parameters

| Parameter Name   | Type & Value                                                                     |
| ---------------- | -------------------------------------------------------------------------------- |
| metadata.total   | Integer; Total number of destinations in request                                 |
| metadata.success | Integer; Number of successfully added destinations                               |
| metadata.failed  | Integer; Number of failed destinations                                           |
| id               | String; Unique identifier for this destination URI. Example: 2543                |
| destination      | String; The SIP URI (prefixed with sip:)                                         |
| type             | String; Destination type: public                                                 |
| priority         | Integer; Priority for load balancing. Lower values = higher priority. Default: 0 |
| weight           | Integer; Weight for load balancing. Higher values = more traffic. Default: 1     |
| trunk\_sid       | String; The trunk this destination is associated with                            |
| date\_created    | String; ISO 8601 timestamp when destination was created                          |
| date\_updated    | String; ISO 8601 timestamp when destination was last updated                     |

for Inbound SIP&#x20;

a. Create a Flow using Connect Applet in App Bazaar: <u>https\://my.in.exotel.com/apps</u>

b. Use sip:\<trunk\_sid> in the Dial Whom field

c. Map DID to flow through Exophone: <u>https\://my.in.exotel.com/numbers</u>

d. Check inbound call flow by dialling Exophone/phonenumber to your system via Exotel SIP trunking

e. Follow detailed steps here :[Setup Call Flow with Exotrunk](docId\:eUVmVKznXnkM6zSjoC9gw)

f. Advance Routing: For custom routing, use a Dynamic URL to fetch the destination URI and pass headers or define failover use [Connect Applet Setup for Inbound SIP Trunking](docId:7ZFyx-upP3BvU2m5HXi1E)

