0
votes

We have a Twilio conference setup in place, and the main user (moderator) is able to do some management of the conference from a conference menu. To access this, they press *.

This is set when the conference is first created as follows (from within Functions):

exports.handler = function(context, event, callback) {

    let twiml = new Twilio.twiml.VoiceResponse();
    let twilio_call_id = event.twilio_call_id;

    twiml.dial({
        hangupOnStar: true,
        action: "https://" + context.DOMAIN_NAME + "/clientConferenceMenu",
        method: 'POST'
    }).conference(twilio_call_id, {
        startConferenceOnEnter: true,
        endConferenceOnExit: false,
        statusCallbackEvent: "join end leave hold",
        statusCallback: "https://" + context.DOMAIN_NAME + "/callStatus",
        record: "record_from_start",
        participantLabel: "Client"
    });
    return callback(null, twiml);
});

Once the user has entered the conference menu, they can go back into the conference using a specific option - in this case press 3 (or say return).

If they press option 3, if attempts to add them back into the conference:

client.conferences(conference_id)
  .fetch()
  .then((conference) => {
    console.log("Conference: ", conference);
    twiml.dial({
      hangupOnStar: true,
      action: "https://" + context.DOMAIN_NAME + "/clientConferenceMenu",
      method: 'POST'
    }).conference(conference.friendlyName, {
      startConferenceOnEnter: true,
      endConferenceOnExit: false,
      statusCallbackEvent: "join end leave hold",
      statusCallback: "https://" + context.DOMAIN_NAME + "/callStatus",
      record: "record_from_start",
      participantLabel: "Client"
    });
    return callback(null, twiml);
  });

However... what it actually does, is create a new conference with the same name, but a different actual room. I think I either need to add them back using the conference-SID, but I don't see a way of doing that, or somehow, take them off hold.

Any help gratefully received :)

1
As long as the conference is still running with other participants, using the conference name should join the same room. Are you testing this with other participants?philnash
I thought that was the case... looks like another support ticket to Twilio is required :(Nunners
Yeah, that is weird and unexpected. I'd be interested to know what the outcome is here!philnash

1 Answers

0
votes

Twilio Support came good.

My original "rejoin" twiml:

twiml.dial({
    hangupOnStar: true,
    action: "https://" + context.DOMAIN_NAME + "/clientConferenceMenu",
    method: 'POST'
}).conference(twilio_call_id, {
    startConferenceOnEnter: true,
    endConferenceOnExit: false,
    statusCallbackEvent: "join end leave hold",
    statusCallback: "https://" + context.DOMAIN_NAME + "/callStatus",
    participantLabel: "Client"
});

Their suggestion was to take out the conference "options":

twiml.dial({
    hangupOnStar: true,
    action: "https://" + context.DOMAIN_NAME + "/clientConferenceMenu",
    method: 'POST'
}).conference(twilio_call_id);

That did the trick! :)