Reputation: 5735
I have the following Twilio code. The phone does not ring and takes a while for the audio to start playing.
Is there a way to get the phone to ring 2-3 times, and while it is ringing, have twilio download the audio file so there is no delay when answered?
<Response>
<Play>http://domain.com/voice.wav</Play><Record transcribe="true" maxLength="119" transcribeCallback="/recording/create?agent=234"/>
<Say voice="alice" language="en-GB">No recording.</Say>
<Hangup/>
</Response>
Upvotes: 1
Views: 930
Reputation: 708
This might also help someone.
The <Pause>
verb waits silently for a specific number of seconds. If <Pause>
is the first verb in a TwiML document, Twilio will wait the specified number of seconds before picking up the call.
Documentation: https://www.twilio.com/docs/voice/twiml/pause
Upvotes: 0
Reputation: 73029
Twilio developer evangelist here.
We can't add in fake ringing, but I don't think that's the issue you have here.
What you're asking for is that Twilio downloads the file so that it's ready to play instantly. There's a couple of things here.
Firstly, Twilio will cache audio files based on the caching headers you return. If you want Twilio to have a cached copy of your audio, make sure you set the correct cache headers.
Secondly, even once the audio is cached there is a chance that there will be some latency on the line. This is much like latency on the web, if the call is further away from our servers, then there will be a bit of latency that can't currently be avoided.
Let me know if that helps at all.
Upvotes: 2