Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Love Code
Added: Jun 6, 2018 12:54 AM
Views: 15
Tags: no tags
If the caller does not speak at all, the <Record> verb exits after 5 seconds of silence, falling through to the next verb in the document. In this case, it would fall through to the <Say> verb.
If the caller speaks for less than 20 seconds and is then silent for 5 seconds, Twilio makes a GET request to the 'action' URL. The <Say> verb is never reached.
If the caller speaks for the full 20 seconds, Twilio makes a GET request to the 'action' URL. The <Say> verb is never reached.
  1. const VoiceResponse = require('twilio').twiml.VoiceResponse;
  2.  
  3. const response = new VoiceResponse();
  4. response.say(
  5.   'Please leave a message at the beep.\nPress the star key when finished.'
  6. );
  7. response.record({
  8.   action: 'http://foo.edu/handleRecording.php',
  9.   method: 'GET',
  10.   maxLength: 20,
  11.   finishOnKey: '*',
  12. });
  13. response.say('I did not receive a recording');
  14.  
  15. console.log(response.toString());