1

I do not see any documentation in creating a conference call in twilio functions

Alex Baban
  • 11,312
  • 4
  • 30
  • 44
martinii
  • 141
  • 10
  • Does this answer your question? [Initiating an outbound call using Twilio Function](https://stackoverflow.com/questions/63996304/initiating-an-outbound-call-using-twilio-function) – Vega Sep 22 '20 at 06:09

1 Answers1

2

You could start with something like this:

exports.handler = function(context, event, callback) {
  
  // create response object (to return TwiML)
  let response = new Twilio.twiml.VoiceResponse();
  
  // dial a conference room
  const dial = response.dial();
  dial.conference('Some Room');
  
  // for debug
  console.log(response.toString());
  
  // return conference TwiML
  return callback(null, response);

};

This is similar with how a forward call Twilio function would be, but instead you "dial" a conference room, not a number.

Configure your Twilio number so it runs the function when a call comes in.

With the new Twilio functions interface, you'll need to create a service before you create a function. If you want to see the logs, you'll need to togle "Enable live logs" to see the console.log(response.toString());.

enter image description here


You can get more inspiration from the docs for Node.js here: https://www.twilio.com/docs/voice/twiml/conference

Alex Baban
  • 11,312
  • 4
  • 30
  • 44
  • I've added a picture, the button is on the bottom right, before the red "Clear". – Alex Baban Sep 22 '20 at 04:56
  • I can't see it. I'm using Functions(Classic). – martinii Sep 22 '20 at 05:03
  • For classic, the logs also show when your function is executed. They appear at the bottom, in a pane under the editor. – Alex Baban Sep 22 '20 at 05:09
  • How can I add participants to the current conference? Should I use statusCallback and create a Twiml Function to handle that callback? For example, I want to call a number and add that number to the current conference. – martinii Sep 22 '20 at 05:39
  • I have not tried it but, yes, it could work. Once they answer serve them the TwiML for the conference. Also take a look at this https://www.twilio.com/docs/voice/api/conference-participant-resource#create-a-participant-agent-conference-only – Alex Baban Sep 22 '20 at 06:08
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/221852/discussion-between-martinii-and-alex-baban). – martinii Sep 22 '20 at 06:40