Overview
Exotel SIP Trunking – Quick Start
12 min
this guide helps you make your first outbound and inbound call using exotel sip trunking by the end of this guide, you will make outbound calls from your sip system to pstn receive inbound calls from pstn to your sip system prerequisites create or use exotel account https //my in exotel com/auth/register completed kyc https //docs exotel com/business phone system/kyc verification api credentials https //my in exotel com/apisettings/site#api credentials at least one exophone (did) https //my in exotel com/numbers sip system (pbx / sbc / contact center) with public static ip sip over tls or tcp enabled refer docid\ qi8949q mzwt0dakm4zqh you will need api key api token account sid step 1 create sip trunk create a logical sip trunk curl s x post "https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks" \\ h "content type application/json" \\ d '{ "trunk name" "my trunk", "nso code" "any any", "domain name" "\<account sid> pstn exotel com" }' save the trunk sid step 2 map phone number to trunk associate your exophone (did) with the trunk curl s x post "https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks/\<trunk sid>/phone numbers" \\ h "content type application/json" \\ d '{ "phone number" "+919876543210" }' default mode is pstn save the numeric id from the response step 3 map acl for outbound sip(whitelist ips) this is required for outbound/termination sip allowing your system to send calls through the trunk required for outbound calls sip authentication ip based inbound destinations curl s x post "https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks/\<trunk sid>/whitelisted ips" \\ h "content type application/json" \\ d '{ "ip" "\<your public ip>", "mask" 32 }' step 4 map destination uri for inbound sip (mandatory) configures where incoming calls should be routed this is required for inbound/origination calls routing calls from the telephone network to your system this defines the network endpoint of the trunk using ip (ip must be whitelisted in step 3) curl s x post "https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks/\<trunk sid>/destination uris" \\ h "content type application/json" \\ d '{ "destinations" \[ { "destination" "\<your public ip> 5061;transport=\<tls/tcp>" } ] }' using fqdn (no ip whitelist required) curl curl s x post "https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks/\<trunk sid>/destination uris" \\ h "content type application/json" \\ d '{ "destinations" \[ { "destination" "sip yourcompany com 5061;transport=\<tls/tcp>" } ] }' step 5 create flow for inbound calls inbound calls are routed through exotel flow go to app bazaar https //my in exotel com/apps create a new flow add connect applet in dial whom , enter sip \<trunk sid> 6\ this connects the flow to your sip trunk step 6 map did to flow bind the exophone (did) to the flow go to exophone manager https //my in exotel com/numbers select your number or purchase set exopone to the flow created above inbound call path is now pstn → exotel → did→ flow(connect applet)→ sip trunk → destination uri → your sip system step 7 configure sip system setting value sip domain \<account sid> pstn exotel com port 443 (tls) or 5070 (tcp) transport tcp or tls authentication ip based ensure rtp ports (udp 10000–40000) are open step 8 test calls outbound dial any pstn number from your sip system inbound call your exophone from a mobile phone if both succeed, setup is complete flow mode clarification (important) flow type phone number mode connect applet (sip \<trunk sid>) pstn voicebot / other app bazaar applets flow destination uri is required in all cases
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.
