Instead of connecting calls directly to phone numbers, you can also use our system to connect to a Session Initiation Protocol (SIP) trunk. This option provides you with greater flexibility and control over your telecommunication system. Here's how to do it:
Use the 'connect' action to connect a call to your SIP trunk. The mechanism is similar to connecting to a phone number, but in this case, you'll provide the SIP URI of your trunk instead of a phone number.
The components in the SIP URI are: sip|sips:[recipient@]:ip/hostname[:port][;transport=tcp|udp]
If you do not specify the recipient in the SIP URI it will default to the called number.
Examples: sip:sip.example.com sips:sip.example.com:5061 sip:sip.example.com:5060 sip:sip.example.com:5060;tranport=tcp sip:+46123456@sip.example.com sip:+46123456@sip.example.com;transport=udp
{
"connect": "sip:+4612345678@example.com:5060;transport=udp",
"callerid": "+46766861234", // Optional
"next": "https://yourapp.example/elks/calls", // Optional
}
POST https://yourapp.example/elks/calls
| Parameter | Description |
|---|---|
| callid | The unique id of the call in our systems. |
| result | The result of the connect. Can be ”success”, ”failed” or ”busy”. |
Many common SIP trunks are allowed by default. If your SIP trunk isn't recognised, you'll need to have it added, just contact our support and we will be happy to whitelist it for you. Some popular services allowed by default are:
You will need to modify your firewall settings to allow traffic from our servers. By default we use UDP on port 5060 unless you specify anything else in the SIP URI. The IP addresses we use for SIP traffic to your server can be found here.