Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support getPeersForCall for federated calls #12936

Closed
SystemKeeper opened this issue Aug 10, 2024 · 0 comments · Fixed by #12962
Closed

Support getPeersForCall for federated calls #12936

SystemKeeper opened this issue Aug 10, 2024 · 0 comments · Fixed by #12962
Labels
Milestone

Comments

@SystemKeeper
Copy link
Contributor

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Currently getPeersForCall is not supported for federated calls. On talk-ios we are using that API to determine 2 things, while the phone is ringing:

  • When there are no peers returned, we stop ringing, because the other participant ended the call.
  • When we join from another device (e.g. web) there's no reason to keep ringing and we hang up as well

/**
* Get the peers for a call
*
* @return DataResponse<Http::STATUS_OK, TalkCallPeer[], array{}>
*
* 200: List of peers in the call returned
*/
#[PublicPage]
#[RequireCallEnabled]
#[RequireModeratorOrNoLobby]
#[RequireParticipant]
#[RequireReadWriteConversation]
public function getPeersForCall(): DataResponse {
$timeout = $this->timeFactory->getTime() - Session::SESSION_TIMEOUT;
$result = [];
$participants = $this->participantService->getParticipantsInCall($this->room, $timeout);
foreach ($participants as $participant) {
$displayName = $participant->getAttendee()->getActorId();
if ($participant->getAttendee()->getActorType() === Attendee::ACTOR_USERS) {
if ($participant->getAttendee()->getDisplayName()) {
$displayName = $participant->getAttendee()->getDisplayName();
} else {
$userDisplayName = $this->userManager->getDisplayName($participant->getAttendee()->getActorId());
if ($userDisplayName !== null) {
$displayName = $userDisplayName;
}
}
} else {
$displayName = $participant->getAttendee()->getDisplayName();
}
$result[] = [
'actorType' => $participant->getAttendee()->getActorType(),
'actorId' => $participant->getAttendee()->getActorId(),
'displayName' => $displayName,
'token' => $this->room->getToken(),
'lastPing' => $participant->getSession()->getLastPing(),
'sessionId' => $participant->getSession()->getSessionId(),
];
}
return new DataResponse($result);
}

@SystemKeeper SystemKeeper added this to the 💙 Next Beta (30) milestone Aug 10, 2024
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 💬 Talk team Aug 14, 2024
@nickvergessen nickvergessen moved this from 🧭 Planning evaluation (don't pick) to 📄 To do (~10 entries) in 💬 Talk team Aug 14, 2024
@github-project-automation github-project-automation bot moved this from 📄 To do (~10 entries) to ☑️ Done in 💬 Talk team Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants