|
|
|
@ -1639,10 +1639,11 @@ class RoomController extends AEnvironmentAwareController { |
|
|
|
/** |
|
|
|
* Reset call ID of a dial-out participant when the SIP gateway rejected it |
|
|
|
* |
|
|
|
* @param array{actorId?: string, actorType?: string, attendeeId?: int} $options Additional details to verify the validity of the request |
|
|
|
* @return DataResponse<Http::STATUS_OK|Http::STATUS_BAD_REQUEST|Http::STATUS_UNAUTHORIZED|Http::STATUS_NOT_FOUND|Http::STATUS_NOT_IMPLEMENTED, array<empty>, array{}> |
|
|
|
* |
|
|
|
* 200: Call ID reset |
|
|
|
* 400: Call ID mismatch |
|
|
|
* 400: Call ID mismatch or attendeeId not found in $options |
|
|
|
* 401: SIP request invalid |
|
|
|
* 404: Participant was not found |
|
|
|
* 501: SIP dial-out is not configured |
|
|
|
@ -1651,7 +1652,7 @@ class RoomController extends AEnvironmentAwareController { |
|
|
|
#[PublicPage]
|
|
|
|
#[BruteForceProtection(action: 'talkSipBridgeSecret')]
|
|
|
|
#[RequireRoom]
|
|
|
|
public function rejectedDialOutRequest(int $attendeeId, string $callId): DataResponse { |
|
|
|
public function rejectedDialOutRequest(string $callId, array $options = []): DataResponse { |
|
|
|
try { |
|
|
|
if (!$this->validateSIPBridgeRequest($this->room->getToken())) { |
|
|
|
$response = new DataResponse([], Http::STATUS_UNAUTHORIZED); |
|
|
|
@ -1664,12 +1665,16 @@ class RoomController extends AEnvironmentAwareController { |
|
|
|
return $response; |
|
|
|
} |
|
|
|
|
|
|
|
if (empty($options['attendeeId'])) { |
|
|
|
return new DataResponse([], Http::STATUS_BAD_REQUEST); |
|
|
|
} |
|
|
|
|
|
|
|
if (!$this->talkConfig->isSIPConfigured() || !$this->talkConfig->isSIPDialOutEnabled()) { |
|
|
|
return new DataResponse([], Http::STATUS_NOT_IMPLEMENTED); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
$this->participantService->resetDialOutRequest($this->room, $attendeeId, $callId); |
|
|
|
$this->participantService->resetDialOutRequest($this->room, $options['attendeeId'], $callId); |
|
|
|
} catch (ParticipantNotFoundException) { |
|
|
|
return new DataResponse([], Http::STATUS_NOT_FOUND); |
|
|
|
} catch (\InvalidArgumentException) { |
|
|
|
|