Follow

Twillio and SRV

Created: 5/2015.  Last Updated: 1/2018

 

Twilio does not support RFC 3263, Locating SIP Servers. This is a standard way of locating SIP servers via SRV record lookup. Twilio, however, only attempts to resolve domains via A records, which is incompatible with OnSIP's distributed nature.

You can use a dig command to look up the SRV record for your SIP domain:


> dig _sip._udp.yourdomain.onsip.com SRV

;; ANSWER SECTION:

_sip._udp.yourdomain.onsip.com. 86400 IN SRV 0 0 5060 sip.onsip.com.

---

sip.onsip.com, in turn, is resolved via GeoDNS to provide a reliable, distributed service entry point. 

There is, however, a work-around with a little bit of effort. 

What you would do is migrate your OnSIP domain to be the same as your primary domain (e.g. acme.com).  Then, your SIP address would be:
 
joe.smith@acme.com
 
as opposed to what it is now:
 
joe.smith@acme.onsip.com
 
You accomplish this by adding an SRV record to your DNS and then in the OnSIP portal choosing the "migrate my domain" setting.  More details can be found here:
 
 
Note:  Trying to resolve the DNS address to an IP address will not work.  username@ipAddress will not work in a multi-hosted environment like OnSIP.

 

 

 

If you migrate your A-record domain to OnSIP, that does appear to work.  Since your domain has an A-record, Twilio will then do an SRV record lookup.  This is still backwards. They should attempt an SRV record lookup irrespective of whether or not an A-record exists.  

Was this article helpful?
0 out of 0 found this helpful

Comments

  • Avatar
    Mike Oeth

    Unfortunately that won't quite work. The result would be username@199.7.173.100 for example. But usernames aren't unique in a multi-domain environment. What is unique is username@domain.