i trying repeat message played in loop entire call duration.
currently works. how can message played, pause of 2 seconds.
this sample code:
<response> <gather> <say voice="woman" loop="0">this message, repeating. how repeat pause of 2 seconds.</say> <pause length="5"></pause> </gather> </response>
the twilio documentation mention use outside say.
https://www.twilio.com/docs/api/twiml/say "if want insert long pause, try using <pause>
verb. <pause>
should placed outside <say>
tags, not nested inside them."
but current implementation, pause never reached.
can guide me on this.
edit: trying use redirect repeat message call gets dropped within 2 seconds once answered. adding pause not casuing this, redirect is, can guide me if there wrong in this?
public twimlresponse mymethod(){ twimlresponse twimlresponse = new twimlresponse(); gather gather = new gather(); gather.setfinishonkey("any digit"); gather.setnumdigits(1); gather.setaction("myendpoint"); say = new say("this message needs repeat pause"); //pause pause = new pause(); //pause.setlength(2); redirect redirect = new redirect("myendpoint"); try { gather.append(say); //gather.append(pause); gather.append(redirect); twimlresponse.append(gather); } catch (twimlexception e) { logger.warn("exception " + e); } return twimlresponse; }
twilio developer evangelist here.
you can use <redirect>
verb in twilio loop <say>
, <pause>
. use this:
/gather.xml
<response> <gather> <say voice="woman">this message, repeating. how repeat pause of 2 seconds.</say> <pause length="2"></pause> </gather> <redirect>/gather.xml</redirect> </response>
let me know if helps.