0

How can I enable recoring for calls made by Twilio client js?

I am using Apex (Salesforce) to generate the token

Javascript Code

Twilio.Device.setup("{! token }");

Apex Code

TwilioCapability capability = TwilioAPI.createCapability();
capability.allowClientOutgoing(
    TwilioAPI.getTwilioConfig().ApplicationSid__c,null);
    capability.allowClientIncoming(UserInfo.getUserId());

public String getToken() { return capability.generateToken(); }
ipradhansk
  • 352
  • 1
  • 10
  • 36

1 Answers1

0

Twilio evangelist here.

This depends on what TwiML your Twilio Application is returning when the instance of Client connects to Twilio.

If you are returning the <Dial> verb, then you can include the record attribute and Twilio will beginning recording the call when the second party picks up.

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial timeout="10" record="true">415-123-4567</Dial>
</Response>

If you are not returning <Dial> then you can include the <Record> verb in your response to have Twilio being recording the call.

<Response>
    <Record timeout="10" transcribe="true" />
</Response>

Hope that helps.

Devin Rader
  • 10,260
  • 1
  • 20
  • 32