voximplant

Voximplant: Get record URL


I am trying to make outbound call with:

 call = VoxEngine.callPSTN(number, caller);
 //call1: event incoming alerting call +573202336398
 //call2: newly created outgoing call  +13213627981
 VoxEngine.easyProcess(e.call, call);

How can I get record url when the disconnect event appears? It works with the event RecordStarted, but with event RecordStopped it's showing me nothing.


Solution

  • You could create a global scope variable and later on obtain the url from RecorderEvents.Started.

    let url = "", recorder;
    
    recorder = VoxEngine.createRecorder({ hd_audio: true });
    recorder.addEventListener(RecorderEvents.Started, (ev) => {
        url = ev.url;
    });
    call1.sendMediaTo(recorder);
    call2.sendMediaTo(recorder);