Call someone with Twilio then disconnect me and play a message to other person

Viewed 965

I'm trying to create a button on a webpage (on my presonal PHP webserver) that should connect me (either call my cellphone or via the webclient), then call a number, I then want to have an options to either hangup the call, or just disconnect me but play an mp3 to the other person and then hangup.

I'm not sure how to go about it. I created a TwiML, but how do I connect that to the existing call? Or is there a different way to do it?

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Play>https://something-something.twil.io/assets/recording1.mp3</Play>
  <Hangup/>
</Response>

Thanks in advance.

2 Answers
Related