2

I want to be able to record the call that's being initialized through the PlivoWebSDK. How can I accomplish that without having to change my whole setup to API or XML. Both seems to be much more complicated to me.

function RecordTheCall(CallUUID)
        {
            console.log(callUuid);
            var auth_id = "MAM2M4ZGE3NJIWMGRIM2";
            var url = "https://api.plivo.com/v1/Account/"+auth_id+"/Call/"+CallUUID+"/Record/";
            $.ajax({
                url: url,
                type: "POST",
                data: { 'auth_id': auth_id, 'call_uuid': CallUUID },
                dataType: "json",
                success: function (res) {
                    alert(res);
                },
                error: function(err) {
                    alert(err);
                }
            });
        }
Sandeep Raju Prabhakar
  • 18,652
  • 8
  • 35
  • 44
jhon dano
  • 660
  • 6
  • 23

1 Answers1

2

Call recording cannot be accomplished from the Web SDK directly. You cannot use the Plivo API from your Web browser using Javascript because cross-domain ajax requests are not allowed in browsers for security reasons.

There are 2 ways to record a call initialized from the Plivo Web SDK.

  • Method 1: Using the Plivo XML (The most straight-forward method)
    You can use the Record XML element for recording the call session. More information here.

  • Method 2: Using Plivo API You can use the Record API for recording the call session. More information here

There are some documents available here that can help you get started on using Plivo's Web SDK.

Ramya Raghu
  • 409
  • 3
  • 4
  • i dont understand the xml where do i initiate it and how to, where do i make the request and how? – jhon dano May 16 '15 at 12:21
  • These docs should help you get started on using the Web SDK and configuring your application to return a valid XML - https://www.plivo.com/docs/getting-started/web-sdk/quick-start/ – Ramya Raghu May 25 '15 at 05:14