Using Twilio WITHOUT allowing Anonymous inbound SIP Calls

Has anyone had success getting Twilio Elastic SIP trunking to work without allowing Anonymous inbound SIP Calls? If so, I would appreciate it if you could check my settings.

I have trunks set up to connect to Phonepower and Vitelity, and just added Twilio as I am considering switching from Vitelity. I created a trunk for Termination (outbound dialing) and an outbound route for Twilio and everything is working fine for outbound calls.

I created 4 inbound trunks, Twilio1, Twilio2, Twilio3, Twilio4. One for each of Twilio’s IP addresses in the US. On each of the inbound trunks I have

Outbound CallerID +1720xxxxxxx
CID Options: Allow any CID
Trunk name: Twiliox

Incoming setings:
User context: Twilio_In_x
User details:

(and repeated 4 times, 1 for each of Twilio’s IP addresses).

I have tried a whole variety of other settings in the User details based on what I’ve read on a variety of help pages and posts, but nothing works except setting Allow Anonymous inbound SIP Calls to YES in the Asterisk SIP settings. If Allow Anonymous inbound SIP Calls is set to No, then my FreePBX rejects the incoming call from Twilio.

Is it safe to Allow Anonymous inbound SIP Calls? I cannot lock down my box by IP address at the firewall level because I have several users that connect with SIP clients on a dynamic IP address.

Has anyone found settings for the inbound Trunks for Twilio that allow incoming calls without Anonymous inbound SIP Calls turned on?

I am using FreePBX It is on a CentOS 6.4 VPS. I am behind a router, and all traffic on port 5060 is being forwarded to my FreePBX.

Thanks for your help!

Never mind. When I turned the Anonymous Inbound SIP Calls on and then off, FreePBX had automatically disabled my trunks. Re-enabling them now allows them to work. :slight_smile: