I believe I have resolved the issue with failed originating calls. It appears that quite a few customers (using Asterisk + FreePBX servers) were having the same exact issue whereby random (first or first few) inbound calls were being rejected with a 401 unauthorized error. Unfortunately, none of these customers’ were able to resolve the issue with the exception of one customer: http://community.freepbx.org/t/twilio-inbound-suddenly-stops-working/33216/37
The above customer noticed in the debug logs that the initial originating call actually was connecting to an outbound Twilio trunk instead of the inbound trunk; and failing (obviously) since no incoming settings were configured. When the customer removed all Twilio outbound trunks, he no longer received the originating call failed entries in the log within the Twilio console. He then proceeded to make an inbound and outbound single main Twilio trunk which took care of both incoming and outgoing calls without failed inbound calls.
Since the above resolution was far from ideal, I researched why Twilio’s originating calls would utilize an outbound trunk (initially). The answer was that FreePBX configured trunk settings alphabetically by trunk name and asterisk would read the configuration file from top to bottom. Moreover, if there were duplicate host IPs in the trunk configurations, asterisk (1.6 and later versions) would use the first trunk (from top to bottom) with the duplicate host IP.
So as per the FreePBX Interconnect guide you can download here, I have 4 inbound (US VA) trunks using IPs 54.172.60.0-3, 4 inbound (US OR) trunks using IPs 54.244.51.0-3, and 5 (1 master + 4 subaccount) outbound Twilio trunks using FQDN termination sip uri. A few of the outbound trunks were alphabetically ordered before the inbound trunks. I renamed all outbound trunks, starting with a ‘z’ so that FreePBX would put the outbound Twilio trunks at the end of the configuration file. That did the trick and resolved the inbound ‘failed’ calls.