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

[stable20.1] Allow SIP dial-in in non-public conversations too #4955

Merged
merged 1 commit into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function getSingleRoom(string $token): DataResponse {
$includeLastMessage = !$isSIPBridgeRequest;

try {
$room = $this->manager->getRoomForUserByToken($token, $this->userId, $includeLastMessage);
$room = $this->manager->getRoomForUserByToken($token, $this->userId, $includeLastMessage, $isSIPBridgeRequest);

$participant = null;
try {
Expand Down
5 changes: 3 additions & 2 deletions lib/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,11 @@ public function getRoomForUser(int $roomId, ?string $userId): Room {
* @param string $token
* @param string|null $userId
* @param bool $includeLastMessage
* @param bool $isSIPBridgeRequest
* @return Room
* @throws RoomNotFoundException
*/
public function getRoomForUserByToken(string $token, ?string $userId, bool $includeLastMessage = false): Room {
public function getRoomForUserByToken(string $token, ?string $userId, bool $includeLastMessage = false, bool $isSIPBridgeRequest = false): Room {
$query = $this->db->getQueryBuilder();
$query->select('r.*')
->selectAlias('r.id', 'r_id')
Expand Down Expand Up @@ -441,7 +442,7 @@ public function getRoomForUserByToken(string $token, ?string $userId, bool $incl
$room->setParticipant($row['actor_id'], $this->createParticipantObject($room, $row));
}

if ($room->getType() === Room::PUBLIC_CALL) {
if ($isSIPBridgeRequest || $room->getType() === Room::PUBLIC_CALL) {
return $room;
}

Expand Down