简体   繁体   中英

How can we record Twilio outboud call initiating from browser to phone?

I am using javascript client by Twilio to make calls to any number. But I am not able to find any solution for this.

How do we record an outbound call from browser to a phone, any server-side or client-side solution for this?

I was able to place call successfully using quickstart.js file using below code

document.getElementById('button-call').onclick = function () {

    try {

        if (document.getElementById('CallTo').value != '') {
            var params = {
                To: "+" + document.getElementById('CallTo').value,
                record: 'record-from-ringing-dual'
            };         
            log('Calling ' + params.To + '...');
            console.log('Calling ' + params.To + '...');
            if (device) {
                var outgoingConnection = device.connect(params);
                outgoingConnection.on('ringing', function () {
                    log('Ringing...');
                    document.getElementById('hdnCallIDs').value = outgoingConnection.parameters.CallSid;
                    log(document.getElementById('hdnCallIDs').value);
                });
            }
        } else {
            log('Enter Dialing number...');
        }
    }
    catch (err) {
        log(err.message);
    }

};

You will put the TwiML, for the Dial Verb , to Record the calls returned by the Voice URL of your TwiML Application . You instruct the Twilio clients to use a specific TwiML Application SID when creating their access tokens.

record

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM