Fixed debug references used for call status that were printing Status.Call.Sharing.State. Added GetCurrentCallParticipants method to referesh participant list. Updated UpdateCallStatus to resolve issue with duplicate participants when admitted from the waiting room.

This commit is contained in:
Jason DeVito
2021-08-17 15:56:57 -05:00
parent 6bdda5451b
commit c4f6afa412

View File

@@ -1144,7 +1144,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var existingParticipant =
Status.Call.Participants.FirstOrDefault(p => p.UserId.Equals(participant.UserId));
// found matching participant.UserId
if (existingParticipant != null)
{
Debug.Console(1, this, "[DeserializeResponse] zCommands.listparticipantresult - participant.event: {0} ...updating matching UserId participant with UserId: {1} UserName: {2}",
@@ -1158,11 +1157,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
participant.Event, participant.UserId, participant.UserName);
Status.Call.Participants.Add(participant);
//var emptyList = new List<Participant>();
//Participants.CurrentParticipants = emptyList;
//GetCurrentCallParticipants();
}
break;
@@ -1330,10 +1324,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
OnCallStatusChange(activeCall);
}
}
var emptyList = new List<Participant>();
Participants.CurrentParticipants = emptyList;
//Participants.OnParticipantsChanged();
}
Debug.Console(1, this, "[DeserializeResponse] zEvent.calldisconnect ********************************************");
@@ -1571,12 +1561,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
}
/// <summary>
/// Retrieves the current call participants list
/// </summary>
public void GetCurrentCallParticipants()
{
SendText("zCommand Call ListParticipants");
}
/// <summary>
/// Prints the current call particiapnts list
/// </summary>
public void PrintCurrentCallParticipants()
{
if (Debug.Level <= 0)
{
return;
}
if (Debug.Level <= 0) return;
Debug.Console(1, this, "*************************** Call Participants **************************");
foreach (var participant in Participants.CurrentParticipants)
@@ -1587,11 +1585,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Debug.Console(1, this, "************************************************************************");
}
public void GetCurrentCallParticipants()
{
SendText("zCommand Call ListParticipants");
}
/// <summary>
/// Retrieves bookings list
/// </summary>
@@ -1609,8 +1602,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}",
Status.Call != null ? Status.Call.Status.ToString() : "no call");
//var emptyList = new List<Participant>();
if (Status.Call != null)
{
var callStatus = Status.Call.Status;
@@ -1654,8 +1645,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Type = eCodecCallType.Video,
};
//Participants.CurrentParticipants = emptyList;
ActiveCalls.Add(newCall);
Debug.Console(1, this, "[UpdateCallStatus] IF w/ meeting_id AcitveCalls.Count == {1} - Current Call Status: {0}",
@@ -1667,8 +1656,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
Debug.Console(1, this, "[UpdateCallStatus] IF w/o meeting_id AcitveCalls.Count == {1} - Current Call Status: {0}",
Status.Call != null ? Status.Call.Status.ToString() : "no call", ActiveCalls.Count);
//Participants.CurrentParticipants = emptyList;
}
}
}
@@ -1682,12 +1669,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
existingCall.Status = eCodecCallStatus.Connected;
break;
case zStatus.eCallStatus.NOT_IN_MEETING:
//Participants.CurrentParticipants = emptyList;
existingCall.Status = eCodecCallStatus.Disconnected;
break;
//default:
// Participants.CurrentParticipants = emptyList;
// break;
}
Debug.Console(1, this, "[UpdateCallStatus] ELSE ActiveCalls.Count == {1} - Current Call Status: {0}",
@@ -1722,17 +1705,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Debug.Console(1, this, "[UpdateCallStatus] Active Calls ------------------------------");
//clear participants list after call cleanup
if (ActiveCalls.Count == 0)
{
var emptyList = new List<Participant>();
Participants.CurrentParticipants = emptyList;
}
else
{
var emptyList = new List<Participant>();
Participants.CurrentParticipants = emptyList;
GetCurrentCallParticipants();
}
if (ActiveCalls.Count > 0) GetCurrentCallParticipants();
}
protected override void OnCallStatusChange(CodecActiveCallItem item)