| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,202 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+namespace Telnyx; |
|
| 4 |
+ |
|
| 5 |
+/** |
|
| 6 |
+ * Class Conference |
|
| 7 |
+ * |
|
| 8 |
+ * @package Telnyx |
|
| 9 |
+ */ |
|
| 10 |
+class Conference extends ApiResource |
|
| 11 |
+{
|
|
| 12 |
+ const OBJECT_NAME = "conference"; |
|
| 13 |
+ |
|
| 14 |
+ use ApiOperations\All; |
|
| 15 |
+ use ApiOperations\Create; |
|
| 16 |
+ use ApiOperations\Retrieve; |
|
| 17 |
+ |
|
| 18 |
+ |
|
| 19 |
+ /** |
|
| 20 |
+ * Join an existing call leg to a conference. Issue the Join Conference command |
|
| 21 |
+ * with the conference ID in the path and the call_control_id of the leg you |
|
| 22 |
+ * wish to join to the conference as an attribute. |
|
| 23 |
+ * |
|
| 24 |
+ * @param array|null $params |
|
| 25 |
+ * @param array|string|null $options |
|
| 26 |
+ * |
|
| 27 |
+ * @return |
|
| 28 |
+ */ |
|
| 29 |
+ public function join($params = null, $options = null) |
|
| 30 |
+ {
|
|
| 31 |
+ $url = $this->instanceUrl() . '/actions/join'; |
|
| 32 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 33 |
+ $this->refreshFrom($response, $opts); |
|
| 34 |
+ return $this; |
|
| 35 |
+ } |
|
| 36 |
+ |
|
| 37 |
+ /** |
|
| 38 |
+ * Mute a list of participants in a conference call |
|
| 39 |
+ * |
|
| 40 |
+ * @param array|null $params |
|
| 41 |
+ * @param array|string|null $options |
|
| 42 |
+ * |
|
| 43 |
+ * @return |
|
| 44 |
+ */ |
|
| 45 |
+ public function mute($params = null, $options = null) |
|
| 46 |
+ {
|
|
| 47 |
+ $url = $this->instanceUrl() . '/actions/mute'; |
|
| 48 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 49 |
+ $this->refreshFrom($response, $opts); |
|
| 50 |
+ return $this; |
|
| 51 |
+ } |
|
| 52 |
+ |
|
| 53 |
+ /** |
|
| 54 |
+ * Unmute a list of participants in a conference call |
|
| 55 |
+ * |
|
| 56 |
+ * @param array|null $params |
|
| 57 |
+ * @param array|string|null $options |
|
| 58 |
+ * |
|
| 59 |
+ * @return |
|
| 60 |
+ */ |
|
| 61 |
+ public function unmute($params = null, $options = null) |
|
| 62 |
+ {
|
|
| 63 |
+ $url = $this->instanceUrl() . '/actions/unmute'; |
|
| 64 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 65 |
+ $this->refreshFrom($response, $opts); |
|
| 66 |
+ return $this; |
|
| 67 |
+ } |
|
| 68 |
+ |
|
| 69 |
+ /** |
|
| 70 |
+ * Hold a list of participants in a conference call |
|
| 71 |
+ * |
|
| 72 |
+ * @param array|null $params |
|
| 73 |
+ * @param array|string|null $options |
|
| 74 |
+ * |
|
| 75 |
+ * @return |
|
| 76 |
+ */ |
|
| 77 |
+ public function hold($params = null, $options = null) |
|
| 78 |
+ {
|
|
| 79 |
+ $url = $this->instanceUrl() . '/actions/hold'; |
|
| 80 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 81 |
+ $this->refreshFrom($response, $opts); |
|
| 82 |
+ return $this; |
|
| 83 |
+ } |
|
| 84 |
+ |
|
| 85 |
+ /** |
|
| 86 |
+ * Unhold a list of participants in a conference call |
|
| 87 |
+ * |
|
| 88 |
+ * @param array|null $params |
|
| 89 |
+ * @param array|string|null $options |
|
| 90 |
+ * |
|
| 91 |
+ * @return |
|
| 92 |
+ */ |
|
| 93 |
+ public function unhold($params = null, $options = null) |
|
| 94 |
+ {
|
|
| 95 |
+ $url = $this->instanceUrl() . '/actions/unhold'; |
|
| 96 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 97 |
+ $this->refreshFrom($response, $opts); |
|
| 98 |
+ return $this; |
|
| 99 |
+ } |
|
| 100 |
+ |
|
| 101 |
+ /** |
|
| 102 |
+ * List conference participants |
|
| 103 |
+ * Convert text to speech and play it to all or some participants. |
|
| 104 |
+ * |
|
| 105 |
+ * @param array|null $params |
|
| 106 |
+ * @param array|string|null $options |
|
| 107 |
+ * |
|
| 108 |
+ * @return \Telnyx\Collection |
|
| 109 |
+ */ |
|
| 110 |
+ public function participants($params = null, $options = null) |
|
| 111 |
+ {
|
|
| 112 |
+ $url = $this->instanceUrl() . '/participants'; |
|
| 113 |
+ list($response, $opts) = $this->_request('get', $url, $params, $options);
|
|
| 114 |
+ $this->refreshFrom($response, $opts); |
|
| 115 |
+ return $this; |
|
| 116 |
+ } |
|
| 117 |
+ |
|
| 118 |
+ /** |
|
| 119 |
+ * Dial a new participant into a conference |
|
| 120 |
+ * Convert text to speech and play it to all or some participants. |
|
| 121 |
+ * |
|
| 122 |
+ * @param array|null $params |
|
| 123 |
+ * @param array|string|null $options |
|
| 124 |
+ * |
|
| 125 |
+ * @return \Telnyx\TelnyxObject |
|
| 126 |
+ */ |
|
| 127 |
+ public function dial_participant($params = null, $options = null) |
|
| 128 |
+ {
|
|
| 129 |
+ $url = $this->instanceUrl() . '/actions/dial_participant'; |
|
| 130 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 131 |
+ $this->refreshFrom($response, $opts); |
|
| 132 |
+ return $this; |
|
| 133 |
+ } |
|
| 134 |
+ |
|
| 135 |
+ /** |
|
| 136 |
+ * Speak text to conference participants |
|
| 137 |
+ * Convert text to speech and play it to all or some participants. |
|
| 138 |
+ * |
|
| 139 |
+ * @param array|null $params |
|
| 140 |
+ * @param array|string|null $options |
|
| 141 |
+ * |
|
| 142 |
+ * @return \Telnyx\TelnyxObject |
|
| 143 |
+ */ |
|
| 144 |
+ public function speak($params = null, $options = null) |
|
| 145 |
+ {
|
|
| 146 |
+ $url = $this->instanceUrl() . '/actions/speak'; |
|
| 147 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 148 |
+ $this->refreshFrom($response, $opts); |
|
| 149 |
+ return $this; |
|
| 150 |
+ } |
|
| 151 |
+ |
|
| 152 |
+ /** |
|
| 153 |
+ * Play audio to conference participants |
|
| 154 |
+ * Play audio to all or some participants on a conference call. |
|
| 155 |
+ * |
|
| 156 |
+ * @param array|null $params |
|
| 157 |
+ * @param array|string|null $options |
|
| 158 |
+ * |
|
| 159 |
+ * @return \Telnyx\TelnyxObject |
|
| 160 |
+ */ |
|
| 161 |
+ public function play($params = null, $options = null) |
|
| 162 |
+ {
|
|
| 163 |
+ $url = $this->instanceUrl() . '/actions/play'; |
|
| 164 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 165 |
+ $this->refreshFrom($response, $opts); |
|
| 166 |
+ return $this; |
|
| 167 |
+ } |
|
| 168 |
+ |
|
| 169 |
+ /** |
|
| 170 |
+ * Conference recording start |
|
| 171 |
+ * Start recording the conference. Recording will stop on conference end, or via the Stop Recording command. |
|
| 172 |
+ * |
|
| 173 |
+ * @param array|null $params |
|
| 174 |
+ * @param array|string|null $options |
|
| 175 |
+ * |
|
| 176 |
+ * @return \Telnyx\TelnyxObject |
|
| 177 |
+ */ |
|
| 178 |
+ public function record_start($params = null, $options = null) |
|
| 179 |
+ {
|
|
| 180 |
+ $url = $this->instanceUrl() . '/actions/record_start'; |
|
| 181 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 182 |
+ $this->refreshFrom($response, $opts); |
|
| 183 |
+ return $this; |
|
| 184 |
+ } |
|
| 185 |
+ |
|
| 186 |
+ /** |
|
| 187 |
+ * Conference recording stop |
|
| 188 |
+ * Stop recording the conference. |
|
| 189 |
+ * |
|
| 190 |
+ * @param array|null $params |
|
| 191 |
+ * @param array|string|null $options |
|
| 192 |
+ * |
|
| 193 |
+ * @return \Telnyx\TelnyxObject |
|
| 194 |
+ */ |
|
| 195 |
+ public function record_stop($params = null, $options = null) |
|
| 196 |
+ {
|
|
| 197 |
+ $url = $this->instanceUrl() . '/actions/record_stop'; |
|
| 198 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 199 |
+ $this->refreshFrom($response, $opts); |
|
| 200 |
+ return $this; |
|
| 201 |
+ } |
|
| 202 |
+} |