voximplant

Problems with recording calls in Voximplant


I have problems with recording calls in Voximplant, it seems that they are recorded but it always shows 0 seconds in duration, I try to record the call from the voxengine scenario, and the call is made from an application that implements the sdk to react -native, I want know in which event I should add the code to record the calls, so far I have tried from various events without success, for example from CallEvents.Connected, do you have any suggestions? I pass a fragment of the code of the scenario and capture the result of the call recording. VoxEngine.easyProcess = function (call1, call2, onEstablishedCallback, direct)

{
     call2.addEventListener(CallEvents.Connected, function (e) {
            if (direct) {
                call1.answerDirect(call2);
            } else {
                if(e.scheme && !(call1.is_conf || call2.is_conf))
                    call1.answer(null,{scheme:e.scheme});
                else
                    call1.answer();
            }
            //test record call
            e.call.record({
                expire: VoxEngine.RecordExpireTime.ONEYEAR,
                hd_audio: true
            });
            // end test record call
        });
    };

Solution

  • You can use this helper

    https://voximplant.com/docs/references/voxengine/voxengine/forwardcalltouser

        
    VoxEngine.addEventListener(AppEvents.CallAlerting, function (e) {
        call = e.call;
        call2 = VoxEngine.callUser(""YOURUSER"", call.callerid());
        VoxEngine.easyProcess(call, call2);
        call2.record();
    });
    
    

    This should work for you