INNER CODE UNIT · JavaScript

participantsOnHold

twilio-labs/function-templates · experimental-flex-dialpad/ui-src/src/customActions/index.js:96

    const participantsOnHold = (participant) => {
      return participant.onHold && participant.status === 'joined';
    };
    const snooze = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
    const getLatestConference = (taskSid) => {
      const updatedTask = StateHelper.getTaskByTaskrouterTaskSid(taskSid);
      return updatedTask.conference;
    };

    // check if worker hanging up is last worker on the call
    if (conference.liveWorkerCount === 1) {
      //if so, ensure no other participants are on hold as
      //no external parties will be able to remove them from being on hold.
      conference.participants.forEach(async (participant) => {
        const { participantType, workerSid, callSid } = participant;
        if (participant.onHold && participant.status === 'joined') {
          await Actions.invokeAction('UnholdParticipant', {
            participantType,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…