0
votes

I have a Microsoft Bot Framework bot running using a Twilio channel to send SMS messages. Everything is working, however I need to see if I can find a way to determine the SMS message delivery status. Because the Bot Framework via the Twilio channel is handling all the messaging I can't just set a web hook URL in the Twilio request normally since the Bot Framework handles all that.

Hoping I could override this - I tried to put the URL in the TwiML app's Status Callback URL but it's not firing.

Does anyone know if there is a way to somehow override the Status callback URL in Twilio or get an event back to my Bot?

Thanks

1

1 Answers

1
votes

When you configure the TwiML App, you can add a status callback URL. Then in your bot you can add a new endpoint to receive the status updates. The incoming requests should have the message ids that you can use to map to your conversations.

enter image description here

Bot Framework SDK v4 (Node)

server.post('/MessageStatus', (req, res) => {
  const messageSid = req.body.MessageSid;
  const messageStatus = req.body.MessageStatus;

  console.log(`SID: ${ messageSid }, Status: ${ messageStatus }`);

  res.sendStatus(200);
});

For more details, take a look at the Twillio Staus Callback documentation.