microsoftgraph / microsoftgraph/microsoft-graph-comms-samples

Participant list is empty on incoming calls, even after the call is established.

Open
#579 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
253
Forks
275
Avg merge
1d 5h
Merged PRs (30d)
1

Description

Describe the issue
When answering a call using ICall.AnswerAsync, the calls participant list is initially empty, both when accessing it from the state of ICall.Participants, but also when making an api request to communications/calls/{CallId}/participants after the call has been established.

Querying for specific participantIds, like sourceParticipantId, gives error message "Participant not found"

The list only starts to work after an additional participant update (other than the app joining) happens in a call, for example a third participant joining, or a participant going on hold. Then the client receives an update notification, which updates ICall.Participants, and any subsequent api request correctly returns a populated list.

Code Snippet

public ILocalMediaSession CreateMediaSession()
{
	return communicationsClient.CreateMediaSession(
		new AudioSocketSettings
		{
			StreamDirections = StreamDirection.Sendrecv,
			SupportedAudioFormat = AudioFormat.Pcm16K,
			ReceiveUnmixedMeetingAudio = true
		},
		new VideoSocketSettings
		{
			StreamDirections = StreamDirection.Inactive
		}
	);
}

private async void registerIncomingCall(ICallCollection sender, CollectionEventArgs<ICall> args)
{
	foreach(ICall newCall in args.AddedResources)
        {
		var mediaSession = CreateMediaSession();
		await newCall.AnswerAsync(mediaSession);

		newCall.OnUpdated += OnCallUpdated;
	}
}

private async void OnCallUpdated(ICall sender, ResourceEventArgs<Call> args)
{
	Call call = args.NewResource;
	CallState state = call.State.Value;
	if(state == CallState.Established)
        {
		var statefulParticipants = sender.Participants;
		Console.WriteLine("Number of participants in the stateful participant collection " + statefulParticipants.Count);
		//Number of participants in the stateful participant collection 0

		var callId = sender.Id;
		var participantsRequest = graphClient.Communications.Calls[callId].Participants.Request();
		Console.WriteLine(participantsRequest.GetHttpRequestMessage().ToString());
		/*
                Method: GET, RequestUri: 'https://graph.microsoft.com/v1.0/communications/calls/401f5d00-0765-4f40-afe5-72d29f138841/participants', Version: 2.0, Content: < null >, Headers:
		{
		}*/

		var requestedParticipants = await participantsRequest.GetResponseAsync();
		Console.WriteLine(await requestedParticipants.Content.ReadAsStringAsync());
		//{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#communications/calls('401f5d00-0765-4f40-afe5-72d29f138841')/participants","value":[]}

		var callerId = sender.Resource.IncomingContext.SourceParticipantId;
		var sourceParticipant = await sender.Participants.GetAsync(callerId);
		/*Microsoft.Graph.Communications.Core.Exceptions.ServiceException: 'Code: 8522
		Message: Participant not found*/
	}
}

Expected behavior
A notification is sent when the incoming call is established, to update the state of ICall.Participants
After the incoming call is established, requests to communications/calls/{CallId}/participants return a populated list

Graph SDK (please complete the following information):

  • Microsoft.Graph version 4.18.0
  • Microsoft.Graph.Communications version 1.2.0.5022

Call ID
401f5d00-0765-4f40-afe5-72d29f138841

Additional context

  • Problem does not occur when making a meeting with the graphclient and joining it.
  • Web client is able to display the participant list correctly for the same calls: image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the incoming-call flow in registerIncomingCall with ICall.AnswerAsync, then inspect OnCallUpdated when the call reaches Established. Compare ICall.Participants with communications/calls/{CallId}/participants and the participant update notifications; done means both return a populated participant list immediately after establishment, including the source participant.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.