microsoftgraph / microsoft-graph-comms-samples

Microsoft Graph Communications Samples
MIT License
211 stars 237 forks source link

Bot unable to add participants to meeting. #662

Open kaushi2 opened 1 year ago

kaushi2 commented 1 year ago

Describe the issue When the bot adds participants to a meeting participants are not able to answer the call, they get put on hold and they see multiple windows and cannot resume the call eventually get kicked out.

Video Recording Here https://www.dropbox.com/scl/fi/awixd6zuvvy77ookohygc/Mremoteng-Confcons.Xml-203-Optus-2023-07-24-18-20-48.m4v?rlkey=qjemgyfy6yxw8gapg4g7bonng&dl=0

Code Snippet ///

/// Raise an incident. /// /// The incident data. /// The task for await. public async Task RaiseIncidentAsync(IncidentRequestData incidentRequestData) { // A tracking id for logging purposes. Helps identify this call in logs. var scenarioId = string.IsNullOrEmpty(incidentRequestData.ScenarioId) ? Guid.NewGuid() : new Guid(incidentRequestData.ScenarioId);

        string incidentId = Guid.NewGuid().ToString();

        var incidentStatusData = new IncidentStatusData(incidentId, incidentRequestData);

        var incident = this.IncidentStatusManager.AddIncident(incidentId, incidentStatusData);

        var botMeetingCall = await this.JoinCallAsync(incidentRequestData, incidentId).ConfigureAwait(false);

        // Rehydrates and validates the group call.
        botMeetingCall = await this.RehydrateAndValidateGroupCallAsync(this.Client, botMeetingCall).ConfigureAwait(false);

        foreach (var objectId in incidentRequestData.ObjectIds)
        {
            var makeCallRequestData =
                new MakeCallRequestData(
                    incidentRequestData.TenantId,
                    objectId,
                    "Application".Equals(incidentRequestData.ResponderType, StringComparison.OrdinalIgnoreCase));
            var responderCall = await this.MakeCallAsync(makeCallRequestData, scenarioId).ConfigureAwait(false);
            this.AddCallToHandlers(responderCall, new IncidentCallContext(IncidentCallType.ResponderNotification, incidentId));
        }

        return botMeetingCall;
    }

    /// <summary>
    /// Joins the call asynchronously.
    /// </summary>
    /// <param name="joinCallBody">The join call body.</param>
    /// <param name="incidentId">Incident Id.</param>
    /// <returns>The <see cref="ICall"/> that was requested to join.</returns>
    public async Task<ICall> JoinCallAsync(JoinCallRequestData joinCallBody, string incidentId = "")
    {
        // A tracking id for logging purposes. Helps identify this call in logs.
        var scenarioId = string.IsNullOrEmpty(joinCallBody.ScenarioId) ? Guid.NewGuid() : new Guid(joinCallBody.ScenarioId);

        Microsoft.Graph.MeetingInfo meetingInfo;
        ChatInfo chatInfo;
        if (!string.IsNullOrWhiteSpace(joinCallBody.VideoTeleconferenceId))
        {
            // Meeting id is a cloud-video-interop numeric meeting id.
            var onlineMeeting = await this.OnlineMeetings
                .GetOnlineMeetingAsync(joinCallBody.TenantId, joinCallBody.VideoTeleconferenceId, scenarioId)
                .ConfigureAwait(false);

            meetingInfo = new OrganizerMeetingInfo { Organizer = onlineMeeting.Participants.Organizer.Identity, };
            chatInfo = onlineMeeting.ChatInfo;
        }
        else
        {
            (chatInfo, meetingInfo) = JoinInfo.ParseJoinURL(joinCallBody.JoinURL);
        }

        var tenantId =
            joinCallBody.TenantId ??
            (meetingInfo as OrganizerMeetingInfo)?.Organizer.GetPrimaryIdentity()?.GetTenantId();
        var mediaToPrefetch = new List<MediaInfo>();
        foreach (var m in this.MediaMap)
        {
            mediaToPrefetch.Add(m.Value.MediaInfo);
        }

        var joinParams = new JoinMeetingParameters(chatInfo, meetingInfo, new[] { Modality.Audio }, mediaToPrefetch)
        {
            TenantId = tenantId,
        };

        var statefulCall = await this.Client.Calls().AddAsync(joinParams, scenarioId).ConfigureAwait(false);

        this.AddCallToHandlers(statefulCall, new IncidentCallContext(IncidentCallType.BotMeeting, incidentId));

        this.graphLogger.Info($"Join Call complete: {statefulCall.Id}");

        return statefulCall;
    }

Expected behavior When bot adds participant the participant shoudl be successfully able to answer callsand join the meeting.

Graph SDK (please complete the following information):

  • Microsoft.Graph.Communications.Common 1.2.0.3742
InDieTasten commented 1 year ago

Looking at the recording it looks like the bot is starting a 1-on-1 call with the user. Once the user joins the 1-on-1 call, the bot crashes or otherwise holds the call. The entire interaction seems to be unrelated to the ongoing meeting that you are trying to invite the user into.

That's all I can tell you. I'm not familiar with the incident samples and managing to invite users to meetings or calls, so somebody else would have to take a look at the code you provided. Or my previous paragraph is hint enough for you to figure it out on your own.