| @@ 167-183 (lines=17) @@ | ||
| 164 | * @throws ConflictException |
|
| 165 | * @throws UnprocessableEntityException |
|
| 166 | */ |
|
| 167 | public function removeChannel($bridgeId, $channel) |
|
| 168 | { |
|
| 169 | $uri = "/bridges/$bridgeId/removeChannel"; |
|
| 170 | try { |
|
| 171 | $this->client->getEndpoint()->post($uri, array( |
|
| 172 | 'channel' => $channel, |
|
| 173 | )); |
|
| 174 | } catch (Pest_BadRequest $e) { // Channel not found |
|
| 175 | throw new NotFoundException($e); |
|
| 176 | } catch (Pest_NotFound $e) { // Bridge not found |
|
| 177 | throw new NotFoundException($e); |
|
| 178 | } catch (Pest_Conflict $e) { // Bridge not in Stasis application |
|
| 179 | throw new ConflictException($e); |
|
| 180 | } catch (Pest_InvalidRecord $e) { // Channel not in Stasis application |
|
| 181 | throw new UnprocessableEntityException($e); |
|
| 182 | } |
|
| 183 | } |
|
| 184 | ||
| 185 | public function getType() |
|
| 186 | { |
|
| @@ 87-101 (lines=15) @@ | ||
| 84 | * @throws InvalidParameterException |
|
| 85 | * @throws NotFoundException |
|
| 86 | */ |
|
| 87 | public function controlPlayback($playbackId, $operation) |
|
| 88 | { |
|
| 89 | $uri = "/playbacks/$playbackId/control"; |
|
| 90 | try { |
|
| 91 | $this->client->getEndpoint()->post($uri, array( |
|
| 92 | 'operation' => $operation, |
|
| 93 | )); |
|
| 94 | } catch (Pest_BadRequest $e) { |
|
| 95 | throw new InvalidParameterException($e); |
|
| 96 | } catch (Pest_NotFound $e) { |
|
| 97 | throw new NotFoundException($e); |
|
| 98 | } catch (Pest_Conflict $e) { |
|
| 99 | throw new ConflictException($e); |
|
| 100 | } |
|
| 101 | } |
|
| 102 | ||
| 103 | } |
|
| 104 | ||
| @@ 99-113 (lines=15) @@ | ||
| 96 | * @throws ConflictException |
|
| 97 | * @throws NotFoundException |
|
| 98 | */ |
|
| 99 | public function copyRecording($recordingName, $destinationRecordingName) |
|
| 100 | { |
|
| 101 | $uri = "/recordings/stored/$recordingName/copy"; |
|
| 102 | try { |
|
| 103 | $response = $this->client->getEndpoint()->post($uri, array( |
|
| 104 | 'destinationRecordingName' => $destinationRecordingName, |
|
| 105 | )); |
|
| 106 | } catch (Pest_NotFound $e) { |
|
| 107 | throw new NotFoundException($e); |
|
| 108 | } catch (Pest_Conflict $e) { |
|
| 109 | throw new ConflictException($e); |
|
| 110 | } |
|
| 111 | ||
| 112 | return new StoredRecording($response); |
|
| 113 | } |
|
| 114 | ||
| 115 | /** |
|
| 116 | * Get live recording |
|