I have configured a Twilio Trunk in our Vital PBX but every time a call routed via Twilio to our Vital user, Vital PBX sends 401 challenge and the call fails because from point of view its a Trunk and sent to a configured peer (Vital PBX).
Strangely the 401 from the PBX is not persistent.
I have even configured insecure parameter on the trunk to Invite, and Port under Incoming calls and Outbound calls under the Trunk configuration.
For incoming calls Twilio uses different IP addresses, so, when using SIP you must create one trunk for each of these IPs. When using PJSIP, you only need to define the IP addresses with the CIDR in the match field, so, with PJSIP you will need only one trunk.
Here’s the link with the origination IP addresses of Twilio: