I'm really struggling to figure out what is wrong with my script. I'm trying to setup a conference call that can be muted when the user presses *6. I have the logic working on the server, but no matter what I do in the Twiml, the hangupOnStar doesn't work.
This is the initial twiml when the user has entered the correct pin to the conference;
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
<Dial hangupOnStar="true">
<Conference muted="false">Conf Room 4</Conference>
</Dial>
<Gather action="/twilio/mute" numDigits="1" />
</Response>
I have connected to the conference with 2 phones, so the conference works. But if i press * on either phone, nothing happens, both phones are still in the conference. I tried removing the gather verb and added an action to another script. But pressing star does nothing, so I'm unable to even get to the Gather verb or disconnect myself from the call.
Any ideas?
Thanks
Related
<Response>
<Say voice="man">First Question?</Say>
<Record timeout="15" transcribe="true" finishOnKey="#" transcribeCallback="https://google.com/first_question_callback" />
<Say voice="man">Second Question?</Say>
<Record timeout="15" transcribe="true" finishOnKey="#" transcribeCallback="https://google.com/second_question_callback"/>
</Response>
This code keeps repeating the first Say after the first Record. It needs to progress to the next Say and the next Records... Can someone help please?
Without an action URL defined, the Record verb calls the same TwiML source.
TwiML™ Voice: Record
Keep in mind that by default Twilio will re-request the current
document's URL, which can lead to unwanted looping behavior if you're
not careful. Any TwiML verbs occurring after a are
unreachable.
Why don't you use Twilio Studio for this instead?
Trying to receive recordings of calls. I'm self hosting this twiml code.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial timeout="40"
recordingStatusCallbackEvent="in-progress,completed"
recordingStatusCallback="http://server.com/recording/">
<Number
url="http://server.com/whisper/"
statusCallbackEvent="completed"
statusCallback="http://server.com/status/">
+12142142144
</Number>
</Dial>
</Response>
Everything works as expected except the recording url is never called. The call forwards, the whisper is spoken, the status url is called, but not the recording url.
Twilio Developer Evangelist here. 👋
It looks like you're missing the record attribute. (https://www.twilio.com/docs/voice/twiml/dial#record) If it's not set it's defaulting to do-not-record.
<Response>
<Dial record="record-from-ringing-dual"
recordingStatusCallback="www.myexample.com">
<Number>+15558675310</Number>
</Dial>
</Response>
Can you add it and give it a try? Happy to help if that's not the issue. :)
I'm currently looking at a basic example of create call https://www.twilio.com/docs/voice/api/call#create-a-call-resource.
The TWIML fetched in the url parameter uses the <Gather> verb to call a number via the action attribute then <Say> something on a loop. Once the DTMF input is detected it dials a second number:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather input="dtmf" action="/dial/john" method="POST">
<Say loop="0">Press a key to connect to John</Say>
</Gather>
</Response>
response at /dial/john:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>415-123-4567</Dial>
<Hangup/>
</Response>
Now, my question is would it be possible to use the API to do the exact same and reduce costs? The cost per minute for each call is GBP0.0175 whereas I believe it could be lower using the API / SIP / VOIP?
TIA
Using you can tell Twilio you want to connect to a PSTN phone <Number>, a <Sip> endpoint, a <Client> ID or even a Twilio Programmable Wireless <Sim> card.
Depending on which if these you use they will have different costs.
Hope that helps.
I am sorry. I am a new to this so forgive me in advance. I'm searching for an answer and I was not able to understand when searching previous inquiries.
I am starting a TwiML Bin and so far my code is
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>This call is being recorded for quality assurance purposes</Say> .
<Dial record="true">+1 858-220-8650</Dial>
</Response>
When I receive the forwarded phone call, and I answer it, I want a message to say "phone call from website xyz" and then connect the call.
Is this possible from just within the TwiML Bin? Or do I have to utilize some external code?
You can do it with TwiML Bins, you will need to use the URL attribute on the Number noun to "chain" them together.
First create your whisper bin:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>phone call from website xyz</Say>
</Response>
Then use this with the URL attribute on your existing bin, like this:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>This call is being recorded for quality assurance purposes</Say>
<Dial record="true">
<Number url="https://handler.twilio.com/twiml/xxxxxxxxxxxxxxxxxxxxxxx">
18582208650
</Number>
</Dial>
</Response>
When the call is answered it will say the message from the whisper bin immediately before connecting the calls. Hope this helps! :)
Is there a way with twilio to stop the welcoming message (Say) once the caller input digits and then forward it to the next IVR tree without waiting the whole message ?
Thanks
You can use numDigits attribute in GATHER with a integer value.For example, one might set 'numDigits' to '5' and ask the caller to enter a 5 digit zip code. When the caller enters the fifth digit of '94117', Twilio will immediately submit the data to the 'action' URL.
Check detail on Twilio Docs.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather timeout="10" numDigits="5">
<Say>Please enter your pin number and then press star.</Say>
</Gather>
</Response>
Actually I had the Gather after the Say. Instead I should've wraped the Gather around the say:
<Response>
<Say voice="alice" language="it-IT">...</Say>
<Gather method="POST" numDigits="1" action="/twilio/ServletHandleUserInput" finishOnKey="0">
</Gather>
</Response>
So I amended it alike :
<Response>
<Gather method="POST" numDigits="1" action="/twilio/ServletHandleUserInput" finishOnKey="0">
<Say voice="alice" language="it-IT">...</Say>
</Gather></Response>
Thanks Rubai