Map Destination URI to Trunk
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
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.
Example Request (FQDN-based destination)
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)
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
a. Create a Flow using Connect Applet in App Bazaar: https://my.in.exotel.com/apps
b. Use sip:<trunk_sid> in the Dial Whom field
c. Map DID to flow through Exophone: https://my.in.exotel.com/numbers
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
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 Trunkingprogrammable connect