Possible to update a forwarding number by sending SMS?

48 Views Asked by At

Very new Twilio user and I have a really specific use case and wonder if this is possible?

I am part of a team of volunteers for a water rescue charity and we have an on call Incident Commander (IC). At the moment we have a phone which is passed between incident commanders. This has a Twilio flow so that callers can request a call out, or get basic info such as our email address donation links etc.

What would I like this to to do? My thought is that rather than swapping the phone around, we use our Twilio number and when we swap IC they send an SMS to say update, this then updates a variable which sets their number as the on call divert number.

I.E. John is Incident Commander Mon-Wed. On Monday he sends an update SMS to (mobile number) +44xxxx123456, he gets back a response to say updated.

When we get a call out to (landline number) +44xxxx123456 this diverts to Johns phone. At any point one of our team can message the mobile number with a command such as IC to get a response of who's number is the on call number.

On Thursday I become on call and send an SMS to the mobile number which updates with my phone number and any calls to our landline get diverted to me.

I hope that makes sense ;)

Is that possible, please bear in mind I am a complete newbie to this ;) Thanks

I have tried using a variable in a flow, but I don't think it persists from what I have tested and couldn't get it to divert correctly. May have been syntax possible wrong?

1

There are 1 best solutions below

0
IObert On

Yes, that's possible. You correctly noticed that variables are only stored for the duration of the flow execution. This means you would need to store the number of the current IC somewhere outside the Studio Flow. This could be a Google Doc, Airtable, Redis or Twilio Sync - it's really up to you.

The next step would be to connect this external data store with your flow via an HTTP Request widget or a Functions widget that executes some code to read or write data from the external data store.