Connect callers to a conference

This code snippet shows how to join multiple calls into a conversation.

Multiple inbound calls can be joined into a conversation (conference call) by connecting the call into the same named conference.

Conference names are scoped at the Vonage Application level. For example, VonageApp1 and VonageApp2 could both have a conference called vonage-conference and there would be no problem.

Example

Replace the following variables in the example code:

KeyDescription
VOICE_CONFERENCE_NAME

The named identifier for your conference.

Prerequisites

npm install express body-parser

Write the code

Add the following to conference-call.js:

const Express = require('express');
const bodyParser = require('body-parser');

const app = new Express();
app.use(bodyParser.json());

const onInboundCall = (_, response) => {
  const ncco = [
    {
      action: 'talk',
      text: 'Please wait while we connect you to the conference',
    },
    {
      action: 'conversation',
      name: VOICE_CONF_NAME,
    },
  ];

  response.json(ncco);
};

app.get('/webhooks/answer', onInboundCall);

app.listen(port, () => {
  console.log(`Example app listening on port ${port}`);
});

View full source

Run your code

Save this file to your machine and run it:

node conference-call.js

Try it out

Start your server and make multiple inbound calls to the Vonage Number assigned to this Vonage Application. The inbound calls will be connected into the same conversation (conference).

Further Reading

  • Conference Calling - This guide explains the two concepts Vonage associates with a call, a leg and a conversation.