How to use recording feature using Twilio Client (VoIP)

459 views Asked by At

I am using Twilio Client (VoIP) with nodejs for making a call from my device to a phone. I want a recording functionality also with this but I don't see this API supports it.I see rest API which supports this but then it not supports VOIP. can someone please provide a sample code or any help for this. very sorry for a silly question but I am new to programming. Thanks in advance.

1

There are 1 answers

1
Megan Speir On

The JavaScript Client is actually not making the recording but the TwiML does. You setup your device and establish a connection to Twilio. Audio from your device's microphone is sent to Twilio, and Twilio plays audio through your device's speakers, like on a normal phone call. This is analogous to the way Twilio handles incoming calls from a real phone. All the same TwiML verbs and nouns that are available for handling Twilio Voice calls are also available for handling Twilio Client connections.

So assuming that you are calling a customer's number and want to record the call, you will need to pass this instruction in the TwiML, i.e:

<Response><Dial record=true>[Number to call]</Dial></Response>

Or in node.js:

    resp.dial({
        record:'true'
    });

After the recording is complete, it gets assigned a recording SID just like recordings created via the verb, and you can fetch it via the REST API as documented here: https://www.twilio.com/docs/api/rest/recording#list