Recorder module lets developers record call audio from either single or multiple sources. If audio is sent to the Recorder instance from multiple sources it will be mixed automatically. Please note that module could only record an audio. For video recording use the Call.record({video: true}) method with according option.
Audio records are saved in form of mp3 files. The quality properties are described in the RecorderParameters. The files are accessible via HTTP(S) using URLs that can be received from call logs or by using the GetCallHistory method of HTTP API.

Add the following line to your scenario code to use the module:

 require(Modules.Recorder);

All functions, events and classes of the module can be used only after this line.

Events

RecorderEvents.RecorderError

Is triggered in case of problems during the recording process

Properties
  • error: string

    Error message

  • recorder: Recorder

    Name of the recorder that generated the event

RecorderEvents.Started

Is triggered after the recording start

Properties
  • recorder: Recorder

    Name of the recorder that generated the event

  • url: string

    Record URL

RecorderEvents.Stopped

Is triggered after the recording's stop

Properties
  • cost: string

    Record cost (in the account's currency: USD, EUR or RUR)

  • duration: number

    Record duration (sec)

  • recorder: Recorder

    Name of the recorder that generated the event

Functions

VoxEngine.createRecorder(Recorder)

Recorder

Create new audio recorder

Sources can later be attached using Call.sendMediaTo() etc.
Example

 require(Modules.Recorder);
 var recorder = VoxEngine.createRecorder(); // create Recorder instance
Parameters
Returns

Example

 require(Modules.Recorder);

 VoxEngine.addEventListener(AppEvents.CallAlerting, function (e) {

		var call = e.call,
			recorder = VoxEngine.createRecorder(); // create Recorder instance

		recorder.addEventListener(RecorderEvents.Started, function (recevent) {
			var call_record_url = recevent.url;
		});

		call.addEventListener(CallEvents.Connected, function (callevent) {
			// Start recording the call
			call.sendMediaTo(recorder);
			setTimeout(function () {
				recorder.stop(); // stop recording after 5 seconds
			}, 5000);
		});

		call.answer();

	});