How can you play music in a call with (preferably) a TwiML XML file? I have gotten so far as:
<!-- page located at http://example.com/simple_dial.xml -->
<Response>
<Dial>PHONE NUMBER</Dial>
<Play>
AUDIO FILE URL
</Play>
</Response>
but it waits until PHONE NUMBER hangs up to play the audio. How can I call a phone number, and then play an mp3 in the call?
Initiate a new call via the REST API, using a URL that returns the following TwiML:
<Response>
<Play>AUDIO FILE URL</Play>
</Response>
Here's a quickstart tutorial that talks through the process of making an outbound call with the PHP helper library. It's equally easy with the libraries in the other languages as well.
Related
I'm trying out Twillio's Programmable Voice feature and have implemented basic audio stream processing by referring to this doc. I'm planning to stream audio back to Twillio using the same websocket and want Twillio to play that audio to the caller
Is there any way to achieve this?
This is how my TwiML bins app xml configuration looks like
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Start>
<Stream url="wss://XXXXXXX.in.ngrok.io/media" />
</Start>
<Dial>+91**********</Dial>
</Response>
I referred to Twillio Bi-directional Media-Streams, but it doesn't specify in what format and with what structure I need to send audio bytes back to twillio
Also I found this question where in answer he says sending back audio stream back to twillio websocket is not possible.
Can I get some help here please, to understand how can I achieve this
I am using twiml bin attached to one of my twilio numbers.
When a person calls that number it should be able to dial multiple numbers. I want to stream the call only when the call has been picked up. There can be multiple ongoing streams associated with a twilio number.
<Response>
<Start>
<Stream track="both_tracks" url="wss://XXXX.ngrok.io /twilio-stream">
</Stream>
</Start>
<Dial answerOnBridge="true" >
<Number>+91XXXXXXXXX</Number>
<Number>+91XXXXXXXXX</Number>
</Dial>
</Response>
The above twiml starts the stream as soon as the number is dialed. I want it to start the stream only when the call is received at the other end.
Unfortunately, there isn't a way to do this today, without REST API endpoint control.
You can use the REST API Calls resource to initiate calls intead. The approach you are taking doesn't work very well when the dialed parties are mobile end-points in poor coverage areas and/or devices with voicemail enabled.
I want to use the Whisper in Twilio Studio,
is this possible??
Now I using only Twilio Studio and TwiML Bin
my goal is...
User calls to my Twilio number
Connect call to the support team phone.
After starting the calls between the User(client) & the support team, I want to [Say] a message to the support team then start the calls.
How can I do this??
Twilio developer evangelist here.
Currently you cannot do a whisper with Studio. You could achieve this flow with just TwiML Bins though.
You would need two bins. One to read the message that you want in the whisper and the other two forward the call and point to the whisper.
So, the whisper bin would include TwiML using either <Say> or <Play> for the message, like this:
<Response>
<Say voice="alice">You are getting a call on the support line, the next voice you will hear is the customer.</Say>
</Response>
Then, the bin that responds to the incoming call needs to use <Dial> with a <Number>. The <Number> url attribute should point at the TwiML above for the whisper. Like:
<Response>
<Dial>
<Number url="TWIML_BIN_URL">+123456789</Number>
</Dial>
</Response>
We're trying to use Twilio to create an automated test framework for those IVRs.
We do an outbound call from Twilio to the IVR, use the verb Say/Play to interact with the IVR and we're using Record to capture what the IVR is saying, latter we transcribe it and make the assertions.
When I ask Twilio to call a phone number and I pretend to be the IVR, everything works perfectly. But when I ask Twilio to call the real IVR, apparently the Record verb can't recognize the pauses, when the IVR stops talking and is waiting for some input.
We tried tweak the timeout attribute but no luck, it records everything and only when the IVR ends the call, Twilio give me the callback with the entire recording. We want each interaction with the IVR in a separate audio, the way we have when I'm pretending.
Here is an example of the TwiML with the Record verb:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Record action="http://foo/nextStep"
method="POST"
playBeep="false"
recordingStatusCallback="http://foo/recordStatus"
timeout="2"
transcribe="false"
trim="do-not-trim" />
</Response>
Twilio developer evangelist here.
Rather than using <Record> for this, I would recommend using <Gather input="speech">. The intention of speech input with <Gather> is to react to input to build a voice enabled IVR, but I can only imagine that it will work better in this testing scenario too. It will live transcribe the results for you in place of returning the recordings for you.
Let me know if that helps.
I want to play a sound to the party that is already in a conference, but not to the other party (half of a the beep="true" parameter in <conference> in other words). The process would be like this:
Agent calls into the conference
Client is connected into the conference call
Agent (ONLY) immediately hears a beep on his side only, the client never hears it
I don't understand how I can easily do this since all the documentation around this seems to be with TwiML's verb. Thanks for your help!
You have to play beep to client before adding him to conference. Try this.
<Response>
<Play>beep mp3</Play>// beep mp3 is beep audio file
<Dial>
<Conference>Room 1234</Conference>
</Dial>
</Response>