Skip to main content

startConference (adhoc)

Permet de fusionner plusieurs appels en un appel unique.
Il sera nécessaire d'avoir les informations de l'appel dans callSession.call.
Pour cela, il faudra obligatoirement utiliser l'évènement Wazo.websocket.on('call_updated', onCallUpdated) afin d'obtenir les informations requises.

startConference: (host: CallSession, otherCalls: CallSession[]) => Promise<AdHocAPIConference>;
adHocConference = await Wazo.Phone.startConference(callSession, participants);

callSession : objet CallSession
correspond à l'appel en cours.

participants : array
tableau ocntenant les Id des appels à ajouter à la conférence.

addParticipant (adhoc)

Permet d'ajouter un intervenant à partir d'un appel en cours.
Il sera nécessaire d'avoir les informations de l'appel dans callSession.call.
Pour cela, il faudra obligatoirement utiliser l'évènement Wazo.websocket.on('call_updated', onCallUpdated) afin d'obtenir les informations requises.

adHocConference.addParticipant(participant);
  • Paramètres

    callSession : objet CallSession
    correspond à l'appel en cours à ajouter.

  • Réponse

    adHocConference :
    Il retourne la conférence, avec les informations et les fonctions utiles.

  • Evènement

    Il ne déclenche pas d'évènement.

  • Exemple

    import React, { useState } from "react";

    export const myComponent = () => {
    const [callSession, setCallSession] = useState({}); // contient l'appel actif
    const [callSessions, setCallSessions] = useState({}); // contient l'ensemble des appels (en cours et disponible)
    const [conference, setConference] = useState(null); // contient la conférence

    const initializeWebRtc = async () => {
    // connexion à la ligne SIP
    await Wazo.Phone.connect({ audio: true, video: true });
    };

    const addParticipant = async (callSession) => {
    // ajout de l'appel en cours à la conférence
    conference.addParticipant(callSession);
    };
    };

RemoveParticipant (adhoc)

Permet de quitter la conférence sans mettre fin à la conférence.
Il sera nécessaire d'avoir les informations de l'appel dans callSession.call.
Pour cela, il faudra obligatoirement utiliser l'évènement Wazo.websocket.on('call_updated', onCallUpdated) afin d'obtenir les informations requises.

adHocConference.removeParticipant(callSession);
  • Paramètres

    callSession : objet CallSession
    correspond à l'appel en cours à retirer.

  • Réponse

    adHocConference :
    Il retourne la conférence, avec les informations et les fonctions utiles.

  • Evènement

    Il déclenche le websocket.
    CONFERENCE_ADHOC_PARTICIPANT_LEFT: "conference_adhoc_participant_left"

  • Exemple

    import React, { useState } from "react";

    export const myComponent = () => {
    const [callSession, setCallSession] = useState({}); // contient l'appel actif
    const [callSessions, setCallSessions] = useState({}); // contient l'ensemble des appels (en cours et disponible)
    const [conference, setConference] = useState(null); // contient la conférence

    const initializeWebRtc = async () => {
    // connexion à la ligne SIP
    await Wazo.Phone.connect({ audio: true, video: true });
    };

    const removeParticipant = async (callSession) => {
    // retire l'appel de la conférence
    conference.removeParticipant(callSession);
    };
    };

hangup (adhoc)

Met fin à la conférence pour l'ensemble des participants.
Il sera nécessaire d'avoir les informations de l'appel dans callSession.call.
Pour cela, il faudra obligatoirement utiliser l'évènement Wazo.websocket.on('call_updated', onCallUpdated) afin d'obtenir les informations requises.

adHocConference.hangup();
  • Paramètres

    aucun.

  • Réponse

    adHocConference :
    Il retourne la conférence, avec les informations et les fonctions utiles.
    Notemment avec les valeurs:

    {
    ...adhocConference,
    "finished": true,
    "participant": [],
    }
  • Evènement

    Il déclenche le websocket.
    CONFERENCE_ADHOC_DELETED: "conference_adhoc_deleted"

  • Exemple

    import React, { useState } from "react";

    export const myComponent = () => {
    const [callSession, setCallSession] = useState({}); // contient l'appel actif
    const [callSessions, setCallSessions] = useState({}); // contient l'ensemble des appels (en cours et disponible)
    const [conference, setConference] = useState(null); // contient la conférence

    const initializeWebRtc = async () => {
    // connexion à la ligne SIP
    await Wazo.Phone.connect({ audio: true, video: true });
    };

    const removeParticipant = () => {
    // retire l'appel de la conférence
    conference.hangup();
    };
    };