Map Destination URI to Trunk
9 min
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 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 curl s x post "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/destination uris" \\ h "content type application/json" \\ d '{ "destinations" \[ { "destination" "44 248 146 11 5061;transport=tls" } ] }' example request (fqdn based destination) curl s x post "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/destination uris" \\ h "content type application/json" \\ d '{ "destinations" \[ { "destination" "sip yourcompany com 5061;transport=tls" } ] }' 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) { "request id" "63999f0a98a24a0aa58ab5b74aec9f0a", "method" "post", "http code" 200, "metadata" { "total" 1, "success" 1, "failed" 0 }, "response" \[ { "code" 200, "error data" null, "status" "success", "data" { "id" "2543", "destination" "sip 44 248 146 11 5061;transport=tls", "date created" "2026 01 23t13 38 32z", "date updated" "2026 01 23t13 38 32z", "type" "public", "priority" 0, "weight" 1, "trunk sid" "trmum1f708622631150902801a1n" } } ] } 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 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
