SIGN UP

Audio conferencing

Audio conferencing

 

Audio conferencing functionality offered by VoxImplant is one of the most advanced and flexible audio conferencing implementations you can find. Developers have full control of every call connected to the conference via VoxEngine. For example, it's possible to record particular calls connected to the conference or the whole conference, developers can record only one audio stream that goes to the conference (if you need to get the audio from particular participant). It's possible to play audio file (or TTS) into the conference or to particular participant (call connected to the conference), mute/unmute participants, and even join different conferences together. Our Web SDK lets developers create web client applications for the conference in minutes (WebRTC will be used Chrome/Firefox/Opera or Flash in IE/Safari), same with Mobile SDKs. It's possible to implement convenient conference controls using messaging functionality (inside the call). In addition, SIP software and devices can be connected to the conference. It's hard to imagine audio conferencing service you can't build using VoxImplant. There are only few things we haven't finished yet - wideband audio support and voice activity detection (both are being developed by our brilliant engineering team, so they should become available soon).

Overview

There are two types of conferences that can be created, let's call them Local and Standalone. The main difference between them is in the type of calls that can be connected to the conference. Local conference exists only inside the VoxEngine session, it means you can make some call (session will be created together with the call) then create conference inside the session and connect additional outbound calls (up to 49 calls per session) initiated from the session to the conference. You won't be able to connect new incoming calls to Local conference. It's useful for scenarios when you need to add additional participants on-the-fly during the call (for example, for call whisper in contact center). Standalone conference also exists inside its own VoxEngine session, so you have full control of the conference on VoxEngine level, but in this case the call limit per session is 100 and you can forward incoming calls to the conference (of course, you can make outbound calls from the same session and join them to the conference like with Local conference). VoxEngine sessions don't exist more than 1 minute without any active calls inside, so this type of conference can be started either by specific HTTP request, or by incoming call. We have created this image to help understand the difference between two types of conferences:

Conference Types

The Details

As you can see on the scheme there are two ways of starting the VoxEngine session with Local conference - by making a call or by making StartScenarios request to HTTP API. To create the conference after the session start use the following code:

require(Modules.Conference);
var conf = VoxEngine.createConference();

The following example shows VoxEngine scenario where conference created after the session was started by call:

require(Modules.Conference);
let call, conf;

VoxEngine.addEventListener(AppEvents.CallAlerting, function(e) {
  call = e.call;
  call.answer(); // answer on the call
  call.addEventListener(CallEvents.Connected, handleCallConnected);
  conf = VoxEngine.createConference(); // create conference
});

function handleCallConnected(e) {
  // Connect media between call and conference (two-way audio)
  VoxEngine.sendMediaBetween(conf, e.call);
  /**
   * If we want to send audio only in one direction
   * conf.sendMediaTo(e.call); // from conference to the call
   * e.call.sendMediaTo(conf); // from call to the conference
   */
}

// Make new call and connect it to the conference
function addCallToConference() {
  let new_call = VoxEngine.callPSTN('phone number to call', 'rented or verified phone number');
  new_call.addEventListener(CallEvents.Connected, handleCallConnected);
}

addCallToConference();

And another example where conference created after the session was started by HTTP request:

require(Modules.Conference);
let call1, call2, conf;

// We are assuming that session started with HTTP request
VoxEngine.addEventListener(AppEvents.Started, () => {
  // create conference
  conf = VoxEngine.createConference();
  // call 2 phone numbers and join them to the conference
  // (you can make up to 10 calls for Local conference)
  call1 = VoxEngine.callPSTN('first phone number to call', 'rented or verified phone number');
  call2 = VoxEngine.callPSTN('second phone number to call', 'rented or verified phone number');
  call1.addEventListener(CallEvents.Connected, handleCallConnected);
  call2.addEventListener(CallEvents.Connected, handleCallConnected);
});

function handleCallConnected(e) {
  // Connect media between call and conference (two-way audio)
  VoxEngine.sendMediaBetween(conf, e.call);
}

Developers have full control of all calls in the conference. For example, if we need to mute one of the participants

call.stopMediaTo(conf);

or if we want to play some audio file to the participant

call.startPlayback('http://somewebservice/file.mp3');

If we need to play audio to all conference participants we will need something like that:

require(Modules.Player);

var player = VoxEngine.createURLPlayer('http://somewebservice/file.mp3');
player.sendMediaTo(conf);
player.addEventListener(PlayerEvents.PlaybackFinished, (e) => {
  // check e.error to see if something went wrong
});

Of course, there is a way to record the conference (or particular calls):

require(Modules.Recorder);
var recorder = VoxEngine.createRecorder();
conf.sendMediaTo(recorder); // you can stop recording using recorder.stop();

Let's see how Standalone conference can be created. It can be done either by StartConference request to HTTP API, where you have to specify the name of the conference or by forwarding call to the conference using VoxEngine.callConference. In both cases the conference will be created in a new session (if the conference doesn't exist) where all calls can be processed on VoxEngine scenario level. We will need to create two scenarios for the conference - Conference Gatekeeper (to forward calls to the conference) and Conference Manager (where inbound calls from the gatekeeper can be processed and connected to the conference, and where outbound calls can be initiated and connected to the conference). In addition to the scenarios we will need to create appropriate VoxImplant application rules that will be used to launch required scenarios. Conference Gatekeeper example:

// Handle incoming call from PSTN/SIP/SDK 
VoxEngine.addEventListener(AppEvents.CallAlerting, (e) => {
  // conferenceId will be used in the application rule to forward
  // the call to Conference Manager scenario
  let conf_call = VoxEngine.callConference('conferenceId');
  VoxEngine.easyProcess(e.call, conf_call);
});

It's pretty straightforward - we just forward an incoming call to our conference. We will need to create special Rule in the application rules for that, where conferenceId will be specified in the Rule Pattern and Conference Manager scenario will be assigned. Conference Manager scenario example:

require(Modules.Conference);
require(Modules.Player);
let conf = null, calls = []; // calls array
// Handle incoming call from the gatekeeper
VoxEngine.addEventListener(AppEvents.CallAlerting, function (e) {
  // create conference if it hasn't been created yet
  if (conf == null) {
    conf = VoxEngine.createConference();
  }
  // we can store all calls in array to control them
  calls.push(e.call);
  e.call.answer();
  e.call.addEventListener(CallEvents.Connected, handleCallConnected);
  e.call.addEventListener(CallEvents.Disconnected, handleCallDisconnected);
})
;

function handleCallConnected(e) {
  // Notify the conference about new participant
  const player = VoxEngine.createTTSPlayer('New participant has joined the conference.');
  player.sendMediaTo(conf);
  player.addEventListener(PlayerEvents.PlaybackFinished, function (ee) {
    // Start sending audio between the call and the conference
    VoxEngine.sendMediaBetween(e.call, conf);
  });
}

function handleCallDisconnected(e) {
  // Let the conference know that one of the participants has left the conference
  const player = VoxEngine.createTTSPlayer('Participant has left the conference.');
  player.sendMediaTo(conf);
}

That's it. This scenarios can be modified according to developer needs. For example, to create and join outbound call to the conference remotely, we could use media_session_access_url and make a call to the existing conference session:

VoxEngine.addEventListener(AppEvents.HttpRequest, request => {
  // we can pass number in the request path if required
  // var number = getNumberFromPath(e.path);
  const new_call = VoxEngine.callPSTN('phone number to call', 'rented or verified phone number');
  new_call.addEventListener(CallEvents.Connected, event => {
    VoxEngine.sendMediaBetween(event.call, conf);
  });
});

Adding different standard conferencing features is easy - write some JS code to add access code and passcode check, authorization by Caller ID, or web management interface. Check our GitHub page to get ready-to-use audio conferencing service scenarios and interfaces.

Tags:conference
B6A24216-9891-45D1-9D1D-E7359CEB8282 Created with sketchtool.

Comments(0)

Add your comment

Please complete this field.

Recommended

Get your free developer account or talk with our sales team to learn more about Voximplant solutions
SIGN UP