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.
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.
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.