1

I'm using Java but the question is language-agnostic, so I posted it under twilio-PHP tag too.

My application needs to connect two customers: A and B. I want to transcribe the conversation and find out whether one of the parties did not pick up and screened the other to voicemail.

I'm following the steps in the click-to-call-tutorial

However, it looks like the Rest API supports recording but not transcription. I successfully can do:

    Map<String, String> params = new HashMap<String, String>();
    params.put("From", myTwilioNumber);
    params.put("To", customerAPhoneNumber);
    params.put("Url", "http://MyHandler.jsp");
    params.put("IfMachine", "Hangup");
    params.put("Record", "true");
    Call call = client.getAccount().getCallFactory().create(params);

which gets the entire conversation recorded, but not transcribed!

As a side note -

    params.put("IfMachine", "Hangup"); 

indeed hangs up, when reaches voicemail, but not before leaving a voicemail with random noise. Looks like Twilio's "probing" the response, and by the time it understands it got to voicemail, background noises have been recorded. Which is terrible user experience. Any advice?

Additionally, my call handling servlet does:

TwiMLResponse twimlResponse = new TwiMLResponse();
Say sayMessage = new Say(
    "Hi, customer A, stay on line to speak with customer B?");
twimlResponse.append(sayMessage);
Dial dial = new Dial(customerBPhoneNumber);
twimlResponse.append(dial);

But when I'm looking at the TwiML Verbs , there is no place where I can set params.put("IfMachine", "Continue") . So the field call.getAnsweredBy() is null for the second call. In other words, I cannot know whether conversation between customer A and B ever happened.

Additionally, [TwiML Verb Record] ( https://www.twilio.com/docs/api/twiml/record ) does allow transcription, but if I do

twimlResponse.append(new Record());

it stops the conversation and records one of the customers.

So I cannot direct the REST API to transcribe, and TwiML Verbs does not even record the conversation in a way I want.

Can anyone help?

Thanks.

Scott Mayers
  • 437
  • 6
  • 18

1 Answers1

0

Twilio developer evangelist here.

I'm afraid that when recording both legs of a call, using the REST API, then transcription is not available. Transcription is only available on single messages recorded by the <Record> verb when the recording is under 2 minutes long.

I'd recommend recording the call and downloading the file to be sent off to a third party transcription service in order to transcribe longer, 2 legged calls like that.

In terms of the answering machine detection, it is an experimental feature and requires Twilio to listen to the first few seconds of a call to work out whether it is a machine or not. A good alternative, which can work as part of your <Dial> verb as well, is to use call screening. This is a good article on the pros and cons of AMD, as well as a good description of using human detection by call screening.

Let me know if this helps at all.

Megan Speir
  • 3,745
  • 1
  • 15
  • 25
philnash
  • 70,667
  • 10
  • 60
  • 88