Reputation: 658
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);
}
});
}
Upvotes: 2
Views: 606
Reputation: 409
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.
Upvotes: 2