発信者を会議につなぐ

このコード・スニペットは、複数のコールを会話に参加させる方法を示している。

複数の着信通話を、同じ名前の通話に接続することで、1つの会話(電話会議)にすることができます。 複数の着信通話を同じ名前の 会議に接続します。

会議名はVonage Applicationレベルでスコープされます。 レベルでスコープされます。たとえば、VonageApp1 と VonageApp2 の両方に という名前のカンファレンスを持つことができます。 vonage-conference そうすれば何の問題もない。

サンプルコードの以下の変数を置き換える:

キー説明
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

試してみる

サーバーを起動し、このVonageアプリケーションに割り当てられたVonage Numbersに複数の着信コールをかけます。 に複数のインバウンドコールをかけます。インバウンドコールは 同じ会話(会議)に接続されます。

さらに読む

  • 電話会議 - このガイドでは、Vonageが通話に関連付ける2つの概念、レグと会話について説明します。