Call not recording/transcribing - twilio

My server is returning the following twiml
<?xml version="1.0" encoding="UTF-8"?>
<Response><Dial callerId="+16122610242"><Number>+16128687242</Number></Dial>
<Record recordingStatusCallback="https://myserver.com/twilio/recording" transcribe="true" transcribeCallback="https://myserver.com/twilio/transcribe" trim="trim-silence"/>
</Response>
Why is the call not being recorded and transcribed?

I am pretty sure the record needed to be set on the Dial in order for it to record

Related

Is there any difference between a plain old TwiML `Dial` verb and a single `Number` nested in a `Dial`?

Other than one being slightly more verbose than the other, functionally is there any difference between these two TwiML blocks, assuming there is no additional configuration? I was unable to find anything in the docs.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>111-111-1111</Dial>
</Response>
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Number>111-111-1111</Number>
</Dial>
</Response>
You are right, both TwiML files are equivalent.

Two-way recording with twilio SIP

I have set-up a SIP Domain on twilio and I've configured with the following TwinML :
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial callerId="{{#e164}}{{From}}{{/e164}}">
{{#e164}}{{To}}{{/e164}}
</Dial>
</Response>
I would like to record all inbound and outbound calls coming on this number but it fails.
I have tried this code :
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial callerId="{{#e164}}{{From}}{{/e164}}">
{{#e164}}{{To}}{{/e164}}
</Dial>
<Dial record="record-from-ringing-dual"
recordingStatusCallback="https://sample.org/api/1.1/wf/twiliocalllog"
>
<Number>+339999999</Number>
</Dial>
</Response>
Can you tell me how can I handle this issue?
(For Inbound calls, I did it with Studio and it works properly, but for outbound calls, I can't find the best way).
For the outbound call you need to use the record attribute on the <Dial> that places the call. Like so:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial callerId="{{#e164}}{{From}}{{/e164}}" record="record-from-ringing-dual" recordingStatusCallback="https://sample.org/api/1.1/wf/twiliocalllog">
{{#e164}}{{To}}{{/e164}}
</Dial>
</Response>

Can I insert a variable into TwiML? In particular, to insert the phone number of the number called?

Is there a way to implement the following in TwiML? The goal is to produce a reasonably-sounding voicemail on Twilio.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Pause length="15"/>
<Say voice ="woman">
You have reached the voice mail of ##The_Phone_Number_One_has_Called##.
Please leave a message at the beep.
</Say>
<Record
transcribe="true"
/>
</Response>
I have a bunch of Twilio numbers and would like to have the string "##The_Phone_Number_One_has_Called##" replaced by the number that the caller is calling. Please advice if I should deploy a dedicated TwiML for each phone number.
Using Templates with a TwiML Bin, and Polly voices, try something like this for the bin:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Pause length="15"/>
<Say voice="Polly.Joanna">
You have reached the voice mail of
<say-as interpret-as="telephone">{{To}}</say-as>.
Please leave a message at the beep.
</Say>
<Record
transcribe="true"
/>
</Response>
How to use templates with TwiML Bins
(https://support.twilio.com/hc/en-us/articles/230878368-How-to-use-templates-with-TwiML-Bins)
Amazon Polly
(https://www.twilio.com/docs/voice/twiml/say/text-speech#amazon-polly)
You could do it on your server's code. Just replace the "##The_Phone_Number_One_has_Called##" with the phone that the user called.
Remember that you get the number that the user dialed on the post param "To" on each of Twilio's requests to your server, so from your server you could return:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Pause length="15"/>
<Say voice ="woman">
You have reached the voice mail of $POST["To"].
Please leave a message at the beep.
</Say>
<Record
transcribe="true"
/>
</Response>
And your server will render a different phone each time, and Twilio's will say it. Just a heads up, the $POST["To"] has the format "+1XXXXXXXXXX", so you might want to remove the +1.

Setup whisper for callee - So when I answer, I know where the call is coming from

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! :)

Twilio Gather, take user's input without delays

I am using gather verb to take user's input, but I play mp3 before user press a key.
The problem is I would like to post a user's input to action URL before mp3 file is finished to play.
My TwiML doesn't take any user's inputs until the mp3 file is finished to play.
I am not sure if there is a way to just post user's input right away when user press a key.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Play>http://www.action.com/greeting.mp3?1925924752</Play>
<Play>http://www.action.com/selection.mp3?1925924752</Play>
<Gather NumDigits="1" Timeout="5" Method="GET" Action="Http://www.action.com/handler.Php?Repeated=1"/>
<Redirect Method="GET">http://www.action.com/handler.php?repeated=1</Redirect>
</Response>
Thank you.
Twilio evangelist here.
Just drop those <Play> verbs into your <Gather>:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Play>http://www.action.com/greeting.mp3?1925924752</Play>
<Gather NumDigits="1" Timeout="5" Method="GET" Action="Http://www.action.com/handler.Php?Repeated=1">
<Play>http://www.action.com/selection.mp3?1925924752</Play>
</Gather>
<Redirect Method="GET">http://www.action.com/handler.php?repeated=1</Redirect>
</Response>
Hope that helps.

Resources