Henri Morlaye is a developer in Leon, France. He works for a small company there that builds tools for professionals to facilitate innovative instructive and training environments at their companies.

Until recently, Henri and his team relied on a landline as the main phone system for their company. While searching for a way to modernize, they decided to build a solution themselves with Twilio that would allow for both more flexibility and control.

The team took the simple concept of a Twimlet but decided to give it their own flair. Using Elixir with the Twilio REST API, they were quickly up and calling!

They built the CRUD app with the Phoenix Framework and deployed on Heroku. A Postgresql database table keeps track of the Twilio numbers and phone numbers they point to, stored as embedded structs using an array of maps and Elixir’s Ecto embedded schema.

All Twilio calls are routed to two functions which determine what to do if there is an incoming SMS or a call. The function for SMS sends an email and the function for a call will try in turn each “real” phone number associated with the “virtual” Twilio number.

A call comes in: