Twilio is in a very tough spot, because any relatively large account quickly realizes that they are big enough to roll out their own solution, and in 2017 is very easy to do, from stellar open source options to many vendors willing to sign up just about anybody as a wholesale account. And many have moved away, and will continue to do so. Even with the recent discounts, Twilio is way over priced, and its REST API is simply not in line with what is expected from a communications platform in this day and age. That's why they are trying to will continue to shift to hosted code. Corvisa (acquired by Shoretel) had it right when they had embedded lua.
Disclaimer: I do own some Twilio and several other telco stocks (but I still believe Twilio is way overvalued and buy on dips because a large carrier will eventually buy them out so I'm willing to go for the ride), but I make more money from companies dumping Twilio/Nexmo/Plivo and going with custom solutions.