Recommended Twilio Rails Project Structure?

What is the best structure for this Twilio project?

Phone numbers are sent and saved for later dialing (to start cron)

I have a controller for receiving incoming POST requests and adding numbers to the database. I also have a rake task (called via CRON) that pulls all the numbers that need to be dialed.

Where should I place the method for the actual call? Right now I have it in the controller, would it be better to have it as a module or plugin?

+4
source share
3 answers

I use a controller to handle twilio api calls, but my model contains methods for actually sending calls.

+3
source

If someone thinks they need an example, I suggest you familiarize yourself with Twilio tutorials. Full disclosure: I work for Twilio.

IN we show the flow of calls using <Say> , <Record> and <Gather> TwiML verbs. And we will show you how to maintain a conversation state in a database that spans several webcam requests.

We hope that our structured application will help you get started on your own.

+3
source

I would put it in a model or lib.

Could this be part of the model in which the number is stored? Perhaps method number #?

+1
source

Source: https://habr.com/ru/post/1345468/


All Articles