PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, November 19, 2022

[FIXED] How to bypass audio playing before recording in twilio php api?

 November 19, 2022     twilio, twilio-api, twilio-php     No comments   

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)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing