How do I do simple conditional calling in Twilio based on time of day?

782 views Asked by At

How do I easily, without complex code, redirect a number in Twilio based on time of day? At 8;30 am I want the number to redirect to me at 6:30 pm I want the number to redirect to employee b at 1:00am I want the number to redirect to the call center? At weekends from 6:30pm onwards, i want to redirect to the call center The numbers could be fixed in the code as variables. Just need something to take the hassle out of manually switching who takes calls several times a day.

How do I do this easily without too much coding?
I have basic Python skills, but would be great if I could do this as a Twiml.

Thanks in advance

1

There are 1 answers

0
Megan Speir On

As @Robert suggests, you can achieve this as implied in this question:

Twilio call forwarding for specific time of day

You can't manipulate the time directly in TwiML, but using your favorite Python framework and time module you could code your own solution where response = "<Dial><Number>A_PHONE_NUMBER_FOR_GIVEN_TIME</Number></Dial>" is set for the appropriate number at the appropriate time.

I also found this example on Github which is likely overkill given your scenario but interesting nonetheless.