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.
Audio records are saved in form of mp3 files and are accessible via HTTP(S) using URLs that can be received using 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

Dispatched in case of problems during the recording process

Properties
  • error: string

    Error message

  • recorder: Recorder

    Recorder that generated the event

RecorderEvents.Started

Dispatched after the recording start

Properties
  • recorder: Recorder

    Recorder that generated the event

  • url: string

    Record URL

RecorderEvents.Stopped

Dispatched after the recording stop

Properties
  • cost: string

    Record cost

  • duration: string

    Record duration

  • recorder: Recorder

    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();

	});