0

Is it possible to create a timer that does callback after 5 minutes? In the documentation there seems to be a 5 second execution limit after which everything gets reset. Any workaround?

X10D
  • 600
  • 2
  • 13

1 Answers1

1

Twilio developer evangelist here.

Twilio Functions have an execution limit of 5 seconds and do not offer a scheduler of any sort. There is no workaround short of using a different platform to schedule jobs.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • How about a function that calls itself every 4 seconds? – X10D Mar 14 '19 at 06:00
  • That is not an idea that I would recommend. – philnash Mar 14 '19 at 06:04
  • How can one ask Twilio to provide such functionality? Since Twilio functions are using node.js which has non-blocking asynchronous timers: https://nodejs.org/api/timers.html It would seem they wouldn't use much resources. – X10D Mar 17 '19 at 13:12
  • Functions do use Node, but they are built upon existing compute as a service platforms that have limits for how long a function can run and also charge by the time the function is in use (even if idle, waiting for something to happen). Twilio Functions is currently a simple way to run Node scripts in an environment managed by Twilio. If you need more than that then I recommend looking at the larger compute platforms offerings, like AWS, GCP or Azure, as they will be able to do this. – philnash Mar 18 '19 at 07:58
  • How about using: https://www.twilio.com/docs/voice/twiml/pause Whats the maximum amount of seconds for the pause verb? – X10D Mar 19 '19 at 22:10
  • 1
    Using `` inserts a pause into the flow of a call. You still have to return the TwiML within the 5 second time out of a Function though. A `` does need to be less than the RTP timeout of 60 seconds and practically less than 50 seconds. `` is not built for long pauses because that would be weird for the person on the other end of the phone. – philnash Mar 19 '19 at 22:22
  • Was thinking on a third conference annoucer. But pauses the whole conference? – X10D Mar 20 '19 at 00:24
  • No, `` leaves a gap in the call for the caller on the other end of the call. It's for leaving gaps in messages like: `HelloHow can I help today?`. If you're trying to use this to announce things to people in a conference after 5 minutes, it's not likely to work due to the RTP timeout I mention above. – philnash Mar 20 '19 at 00:27