Issue
I am working in twilio api recording process. I need to play a custom audio before recording . User can listen fully(after they listen fully recording start with beep) or bypass that audio by pressing '#' , then recording start with beep sound. Is it possible to acheive ?
Thanks
Solution
Yeah that's pretty easy.
Nest your <play>
verb within a <gather>
verb, add an action url to the gather verb which points to your TwiML that initiates the call recording, also add a <redirect>
verb at the end of your TwiML which also points to the TwiML which initiates your call recording.
The default finish on key for a gather is #, so if your caller presses that then Twilio will redirect to the record TwiML url straight away.
If the caller presses nothing then Twilio will continue to process the current TwiML, which is why you need a <redirect>
verb at the end. As this also points to the TwiML that initiates recording then users who press nothing will still be redirected to the recording TwiML once your <play>
audio has finished.
Answered By - miknik Answer Checked By - Candace Johnson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.