@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'сal_Last30Days' => 'Últimos 30 dias', |
10 | 10 | 'сal_LastWeek' => 'Últimos 7 dias', |
11 | 11 | 'сal_Yesterday' => 'Ontem', |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'ex_Online' => 'ansluten', |
10 | 10 | 'am_TableColumnDescription' => 'Anmärkningar', |
11 | 11 | 'am_Read' => 'läsning', |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'BreadcrumbAsteriskManagersmodify' => 'Configurazione dell\'account', |
10 | 10 | 'or_PatternToMatch' => 'La regola funzionerà se', |
11 | 11 | 'or_NumberBeginsWithTheDigits' => 'Il numero inizia con', |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'November' => '11月', |
10 | 10 | 'December' => '12月', |
11 | 11 | 'Jan' => 'Jan', |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'mm_SSHConsole' => 'Consola SSH', |
10 | 10 | 'ex_Email' => 'Correo electrónico', |
11 | 11 | 'bt_ToolTipEdit' => 'Editar', |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'January' => 'Januar', |
10 | 10 | 'February' => 'Februar', |
11 | 11 | 'March' => 'März', |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'Oct' => 'oktober', |
10 | 10 | 'Nov' => 'november', |
11 | 11 | 'Dec' => 'december', |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | file_put_contents('/etc/iptables/iptables.mikopbx', implode("\n", $arr_command)); |
86 | 86 | file_put_contents( |
87 | 87 | '/etc/iptables/iptables.mikopbx', |
88 | - "\n" . implode("\n", $arr_commands_custom), |
|
88 | + "\n".implode("\n", $arr_commands_custom), |
|
89 | 89 | FILE_APPEND |
90 | 90 | ); |
91 | 91 | file_put_contents( |
92 | 92 | '/etc/iptables/iptables.mikopbx', |
93 | - "\n" . $dropCommand, |
|
93 | + "\n".$dropCommand, |
|
94 | 94 | FILE_APPEND |
95 | 95 | ); |
96 | 96 | $systemctlPath = Util::which('systemctl'); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | $data_port = ''; |
137 | 137 | if (trim($dport) !== '') { |
138 | - $data_port = '--dport ' . $dport; |
|
138 | + $data_port = '--dport '.$dport; |
|
139 | 139 | } |
140 | 140 | $other_data = trim($other_data); |
141 | 141 | |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | continue; |
169 | 169 | } |
170 | 170 | $other_data = "-p {$rule->protocol}"; |
171 | - $other_data .= ($network_filter === null) ? '' : ' -s ' . $network_filter->permit; |
|
171 | + $other_data .= ($network_filter === null) ? '' : ' -s '.$network_filter->permit; |
|
172 | 172 | if ($rule->protocol === 'icmp') { |
173 | - $port = ''; |
|
173 | + $port = ''; |
|
174 | 174 | $other_data .= ' --icmp-type echo-request'; |
175 | 175 | } |
176 | 176 |
@@ -166,7 +166,7 @@ |
||
166 | 166 | } elseif ( |
167 | 167 | 'event' === $type |
168 | 168 | && $parameters['Event'] === 'UserEvent' |
169 | - && "{$pingTube}Pong" === $parameters['UserEvent']) { |
|
169 | + && "{$pingTube}pong" === $parameters['UserEvent']) { |
|
170 | 170 | // Ответ получен. |
171 | 171 | $result = true; |
172 | 172 | break; |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | public function __construct($config = null, $optconfig = []) |
89 | 89 | { |
90 | 90 | // load config |
91 | - if ( !is_null($config) && file_exists($config)) { |
|
91 | + if (!is_null($config) && file_exists($config)) { |
|
92 | 92 | $arrData = parse_ini_file($config, true); |
93 | - $this->config = ($arrData === false)?[]:$arrData; |
|
93 | + $this->config = ($arrData === false) ? [] : $arrData; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | // If optconfig is specified, stuff vals and vars into 'asmanager' config array. |
@@ -99,16 +99,16 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | // add default values to config for uninitialized values |
102 | - if ( ! isset($this->config['asmanager']['server'])) { |
|
102 | + if (!isset($this->config['asmanager']['server'])) { |
|
103 | 103 | $this->config['asmanager']['server'] = 'localhost'; |
104 | 104 | } |
105 | - if ( ! isset($this->config['asmanager']['port'])) { |
|
105 | + if (!isset($this->config['asmanager']['port'])) { |
|
106 | 106 | $this->config['asmanager']['port'] = 5038; |
107 | 107 | } |
108 | - if ( ! isset($this->config['asmanager']['username'])) { |
|
108 | + if (!isset($this->config['asmanager']['username'])) { |
|
109 | 109 | $this->config['asmanager']['username'] = 'phpagi'; |
110 | 110 | } |
111 | - if ( ! isset($this->config['asmanager']['secret'])) { |
|
111 | + if (!isset($this->config['asmanager']['secret'])) { |
|
112 | 112 | $this->config['asmanager']['secret'] = 'phpagi'; |
113 | 113 | } |
114 | 114 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $req .= "$var: $val\r\n"; |
136 | 136 | } |
137 | 137 | $req .= "\r\n"; |
138 | - if ( ! is_resource($this->socket)) { |
|
138 | + if (!is_resource($this->socket)) { |
|
139 | 139 | return []; |
140 | 140 | } |
141 | 141 | $this->sendDataToSocket($req); |
@@ -149,14 +149,14 @@ discard block |
||
149 | 149 | do { |
150 | 150 | $type = ''; |
151 | 151 | $parameters = []; |
152 | - if ( ! is_resource($this->socket)) { |
|
152 | + if (!is_resource($this->socket)) { |
|
153 | 153 | return false; |
154 | 154 | } |
155 | 155 | $buffer = $this->getStringDataFromSocket(); |
156 | 156 | while (!empty($buffer)) { |
157 | 157 | $a = strpos($buffer, ':'); |
158 | 158 | if ($a) { |
159 | - if ( ! count($parameters)) { |
|
159 | + if (!count($parameters)) { |
|
160 | 160 | $type = strtolower(substr($buffer, 0, $a)); |
161 | 161 | } |
162 | 162 | $parameters[substr($buffer, 0, $a)] = substr($buffer, $a + 2); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | // Таймаут ожидания. |
180 | 180 | break; |
181 | 181 | } |
182 | - } while ( ! $timeout); |
|
182 | + } while (!$timeout); |
|
183 | 183 | |
184 | 184 | return $result; |
185 | 185 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function sendRequestTimeout($action, $parameters = []) |
196 | 196 | { |
197 | - if ( ! is_resource($this->socket) && !$this->connectDefault()) { |
|
197 | + if (!is_resource($this->socket) && !$this->connectDefault()) { |
|
198 | 198 | return []; |
199 | 199 | } |
200 | 200 | // Прописываем обязательные поля. |
@@ -207,15 +207,15 @@ discard block |
||
207 | 207 | $req .= "\r\n"; |
208 | 208 | |
209 | 209 | $result = $this->sendDataToSocket($req); |
210 | - if(!$result) { |
|
210 | + if (!$result) { |
|
211 | 211 | usleep(500000); |
212 | - if($this->connectDefault()){ |
|
212 | + if ($this->connectDefault()) { |
|
213 | 213 | $result = $this->sendDataToSocket($req); |
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
217 | 217 | $response = []; |
218 | - if($result){ |
|
218 | + if ($result) { |
|
219 | 219 | $response = $this->waitResponse(true); |
220 | 220 | } |
221 | 221 | return $response; |
@@ -244,23 +244,23 @@ discard block |
||
244 | 244 | $parameters = []; |
245 | 245 | $response = []; |
246 | 246 | |
247 | - if(!$this->waitResponseGetInitialData($response)) { |
|
247 | + if (!$this->waitResponseGetInitialData($response)) { |
|
248 | 248 | return $parameters; |
249 | 249 | } |
250 | - $buffer = $response['data']??''; |
|
250 | + $buffer = $response['data'] ?? ''; |
|
251 | 251 | while ($buffer !== '') { |
252 | 252 | $a = strpos($buffer, ':'); |
253 | 253 | if ($a) { |
254 | 254 | $event_text = substr($buffer, $a + 2); |
255 | 255 | $this->waitResponseGetEventType($parameters, $buffer, $a, $type); |
256 | - $this->waitResponseReadFollowsPart($event_text,$parameters); |
|
256 | + $this->waitResponseReadFollowsPart($event_text, $parameters); |
|
257 | 257 | $this->waitResponseReadCompletePart($event_text, $parameters); |
258 | 258 | $parameters[substr($buffer, 0, $a)] = $event_text; |
259 | 259 | } |
260 | 260 | $buffer = $this->getStringDataFromSocket(); |
261 | 261 | } |
262 | 262 | $this->waitResponseProcessResponse($type, $timeout, $allow_timeout, $parameters); |
263 | - } while ($type !== 'response' && ! $timeout); |
|
263 | + } while ($type !== 'response' && !$timeout); |
|
264 | 264 | |
265 | 265 | return $parameters; |
266 | 266 | } |
@@ -271,18 +271,18 @@ discard block |
||
271 | 271 | * @return bool |
272 | 272 | */ |
273 | 273 | private function waitResponseGetInitialData(& $response):bool{ |
274 | - if ( !is_resource($this->socket) && !$this->connectDefault()) { |
|
274 | + if (!is_resource($this->socket) && !$this->connectDefault()) { |
|
275 | 275 | return false; |
276 | 276 | } |
277 | 277 | $result = true; |
278 | 278 | $response = $this->getDataFromSocket(); |
279 | - if(isset($response['error'])) { |
|
279 | + if (isset($response['error'])) { |
|
280 | 280 | usleep(500000); |
281 | - if($this->connectDefault()){ |
|
281 | + if ($this->connectDefault()) { |
|
282 | 282 | $response = $this->getDataFromSocket(); |
283 | 283 | } |
284 | 284 | } |
285 | - if(isset($response['error'])) { |
|
285 | + if (isset($response['error'])) { |
|
286 | 286 | $result = false; |
287 | 287 | } |
288 | 288 | return $result; |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | * @param $type |
318 | 318 | */ |
319 | 319 | private function waitResponseGetEventType($parameters, $buffer, $a, & $type):void{ |
320 | - if ( ! count($parameters)) { |
|
320 | + if (!count($parameters)) { |
|
321 | 321 | $type = strtolower(substr($buffer, 0, $a)); |
322 | 322 | } |
323 | 323 | } |
@@ -328,13 +328,13 @@ discard block |
||
328 | 328 | * @param $parameters |
329 | 329 | */ |
330 | 330 | private function waitResponseReadFollowsPart($event_text, & $parameters):void{ |
331 | - if ( ($event_text === 'Follows') && !count($parameters)) { |
|
331 | + if (($event_text === 'Follows') && !count($parameters)) { |
|
332 | 332 | // A follows response means there is a miltiline field that follows. |
333 | 333 | $parameters['data'] = ''; |
334 | 334 | $buff = $this->getStringDataFromSocket(); |
335 | 335 | while (strpos($buff, '--END ') !== 0) { |
336 | 336 | $parameters['data'] .= $buff; |
337 | - $buff = $this->getStringDataFromSocket(); |
|
337 | + $buff = $this->getStringDataFromSocket(); |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | } |
@@ -360,11 +360,11 @@ discard block |
||
360 | 360 | 'Following are Events for each Outbound registration' => 'OutboundRegistrationDetailComplete', |
361 | 361 | 'A listing of Endpoints follows, presented as EndpointList events' => 'EndpointListComplete' |
362 | 362 | ]; |
363 | - $eventsAsNotArray = [ 'EndpointDetailComplete' ]; |
|
363 | + $eventsAsNotArray = ['EndpointDetailComplete']; |
|
364 | 364 | |
365 | - $endString = $settings[$event_text]??false; |
|
366 | - if($endString !== false){ |
|
367 | - $NotArray = !in_array($endString,$eventsAsNotArray); |
|
365 | + $endString = $settings[$event_text] ?? false; |
|
366 | + if ($endString !== false) { |
|
367 | + $NotArray = !in_array($endString, $eventsAsNotArray); |
|
368 | 368 | $this->waitResponseGetSubData($parameters, $endString, $NotArray); |
369 | 369 | } |
370 | 370 | } |
@@ -375,20 +375,20 @@ discard block |
||
375 | 375 | */ |
376 | 376 | private function getDataFromSocket() { |
377 | 377 | $response = []; |
378 | - if(!is_resource($this->socket)){ |
|
378 | + if (!is_resource($this->socket)) { |
|
379 | 379 | $response['error'] = 'Socket not init.'; |
380 | 380 | return $response; |
381 | 381 | } |
382 | 382 | try { |
383 | 383 | $resultFgets = fgets($this->socket, 4096); |
384 | - if($resultFgets !== false){ |
|
384 | + if ($resultFgets !== false) { |
|
385 | 385 | $buffer = trim($resultFgets); |
386 | 386 | $response['data'] = $buffer; |
387 | - }else{ |
|
387 | + } else { |
|
388 | 388 | $response['error'] = 'Read data error.'; |
389 | 389 | } |
390 | 390 | |
391 | - }catch (Throwable $e){ |
|
391 | + } catch (Throwable $e) { |
|
392 | 392 | $response['error'] = $e->getMessage(); |
393 | 393 | } |
394 | 394 | |
@@ -410,16 +410,16 @@ discard block |
||
410 | 410 | * @return bool |
411 | 411 | */ |
412 | 412 | private function sendDataToSocket($req) : bool{ |
413 | - if(!is_resource($this->socket)){ |
|
413 | + if (!is_resource($this->socket)) { |
|
414 | 414 | return false; |
415 | 415 | } |
416 | 416 | $result = true; |
417 | 417 | try { |
418 | 418 | $resultWrite = fwrite($this->socket, $req); |
419 | - if($resultWrite === false){ |
|
419 | + if ($resultWrite === false) { |
|
420 | 420 | $result = false; |
421 | 421 | } |
422 | - }catch (Throwable $e){ |
|
422 | + } catch (Throwable $e) { |
|
423 | 423 | $result = false; |
424 | 424 | } |
425 | 425 | return $result; |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | |
428 | 428 | private function waitResponseGetSubData(&$parameters, $end_string = '', $event_as_array = true): void |
429 | 429 | { |
430 | - if ( ! is_array($parameters)) { |
|
430 | + if (!is_array($parameters)) { |
|
431 | 431 | $parameters = []; |
432 | 432 | } |
433 | 433 | if (empty($end_string)) { |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | $value = ''; |
440 | 440 | $buff = $this->getStringDataFromSocket().$value; |
441 | 441 | $a_pos = strpos($buff, ':'); |
442 | - if ( ! $a_pos) { |
|
442 | + if (!$a_pos) { |
|
443 | 443 | if (count($m) > 0) { |
444 | 444 | if ($event_as_array) { |
445 | 445 | $parameters['data'][$m['Event']][] = $m; |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | { |
492 | 492 | [$usec, $sec] = explode(" ", microtime()); |
493 | 493 | |
494 | - return ((float)$usec + (float)$sec); |
|
494 | + return ((float) $usec + (float) $sec); |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | /** |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | while ($buffer !== '') { |
522 | 522 | $pos = strpos($buffer, ':'); |
523 | 523 | if ($pos) { |
524 | - if ( ! count($parameters)) { |
|
524 | + if (!count($parameters)) { |
|
525 | 525 | $type = strtolower(substr($buffer, 0, $pos)); |
526 | 526 | } |
527 | 527 | $parameters[substr($buffer, 0, $pos)] = substr($buffer, $pos + 2); |
@@ -530,10 +530,10 @@ discard block |
||
530 | 530 | } |
531 | 531 | if ($type === '' && count($this->Ping()) === 0) { |
532 | 532 | $timeout = $allow_timeout; |
533 | - } elseif (stripos($type, 'event')!==false ) { |
|
533 | + } elseif (stripos($type, 'event') !== false) { |
|
534 | 534 | $this->processEvent($parameters); |
535 | 535 | } |
536 | - } while ( ! $timeout); |
|
536 | + } while (!$timeout); |
|
537 | 537 | |
538 | 538 | return $parameters; |
539 | 539 | } |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | if (strpos($server, ':') !== false) { |
573 | 573 | $c = explode(':', $server); |
574 | 574 | $this->server = $c[0]; |
575 | - $this->port = (int)$c[1]; |
|
575 | + $this->port = (int) $c[1]; |
|
576 | 576 | } else { |
577 | 577 | $this->server = $server; |
578 | 578 | $this->port = $this->config['asmanager']['port']; |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | $req .= "$var: $val\r\n"; |
627 | 627 | } |
628 | 628 | $req .= "\r\n"; |
629 | - if ( ! is_resource($this->socket)) { |
|
629 | + if (!is_resource($this->socket)) { |
|
630 | 630 | return []; |
631 | 631 | } |
632 | 632 | $this->sendDataToSocket($req); |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | if (null !== $channels) { |
771 | 771 | foreach ($channels as $chan) { |
772 | 772 | if ($group === true) { |
773 | - if ( ! isset($chan['Linkedid'])) { |
|
773 | + if (!isset($chan['Linkedid'])) { |
|
774 | 774 | continue; |
775 | 775 | } |
776 | 776 | $channels_id[$chan['Linkedid']][] = $chan['Channel']; |
@@ -931,7 +931,7 @@ discard block |
||
931 | 931 | if ($format) { |
932 | 932 | $parameters['Format'] = $format; |
933 | 933 | } |
934 | - if ( ! is_null($file)) { |
|
934 | + if (!is_null($file)) { |
|
935 | 935 | $parameters['Mix'] = ($mix) ? 'true' : 'false'; |
936 | 936 | } |
937 | 937 | |
@@ -950,12 +950,12 @@ discard block |
||
950 | 950 | * |
951 | 951 | * @return array |
952 | 952 | */ |
953 | - public function MixMonitor($channel, $file, $options, $command='') |
|
953 | + public function MixMonitor($channel, $file, $options, $command = '') |
|
954 | 954 | { |
955 | 955 | $parameters = ['Channel' => $channel]; |
956 | 956 | $parameters['File'] = $file; |
957 | 957 | $parameters['options'] = $options; |
958 | - if(!empty($command)){ |
|
958 | + if (!empty($command)) { |
|
959 | 959 | $parameters['Command'] = $command; |
960 | 960 | } |
961 | 961 | |
@@ -1077,8 +1077,8 @@ discard block |
||
1077 | 1077 | 'ActionID' => $actionid |
1078 | 1078 | ]; |
1079 | 1079 | $keys = array_keys($parameters); |
1080 | - foreach ($keys as $key){ |
|
1081 | - if(empty($parameters[$key])){ |
|
1080 | + foreach ($keys as $key) { |
|
1081 | + if (empty($parameters[$key])) { |
|
1082 | 1082 | unset($parameters[$key]); |
1083 | 1083 | } |
1084 | 1084 | } |
@@ -1350,7 +1350,7 @@ discard block |
||
1350 | 1350 | 'Not in use' => 'OK', |
1351 | 1351 | 'Busy' => 'OK', |
1352 | 1352 | ]; |
1353 | - $state = $state_array[$peer['DeviceState']] ?? 'UNKNOWN'; |
|
1353 | + $state = $state_array[$peer['DeviceState']] ?? 'UNKNOWN'; |
|
1354 | 1354 | |
1355 | 1355 | $peers[] = [ |
1356 | 1356 | 'id' => $peer['ObjectName'], |
@@ -1373,12 +1373,12 @@ discard block |
||
1373 | 1373 | $res = $this->sendRequestTimeout('SIPpeers'); |
1374 | 1374 | if (isset($res['data']) && $res['data'] != null && $res['data']['PeerEntry'] != null) { |
1375 | 1375 | foreach ($res['data']['PeerEntry'] as $peer) { |
1376 | - if ( ! is_numeric($peer['ObjectName'])) { |
|
1376 | + if (!is_numeric($peer['ObjectName'])) { |
|
1377 | 1377 | continue; |
1378 | 1378 | } |
1379 | 1379 | // if ('Unmonitored' == $peer['Status']) continue; |
1380 | 1380 | $arr_status = explode(' ', $peer['Status']); |
1381 | - $peers[] = ['id' => $peer['ObjectName'], 'state' => strtoupper($arr_status[0]),]; |
|
1381 | + $peers[] = ['id' => $peer['ObjectName'], 'state' => strtoupper($arr_status[0]), ]; |
|
1382 | 1382 | } |
1383 | 1383 | } |
1384 | 1384 | |
@@ -1419,7 +1419,7 @@ discard block |
||
1419 | 1419 | if (isset($res['data']['ContactStatusDetail'])) { |
1420 | 1420 | $result = $res['data']['ContactStatusDetail']; |
1421 | 1421 | } |
1422 | - $result['state'] = isset($result['URI']) && ! empty($result['URI']) ? 'OK' : 'UNKNOWN'; |
|
1422 | + $result['state'] = isset($result['URI']) && !empty($result['URI']) ? 'OK' : 'UNKNOWN'; |
|
1423 | 1423 | |
1424 | 1424 | return $result; |
1425 | 1425 | } |
@@ -1443,7 +1443,7 @@ discard block |
||
1443 | 1443 | { |
1444 | 1444 | $result = []; |
1445 | 1445 | $conf_data = $this->MeetmeList($conference); |
1446 | - if ( ! isset($conf_data['data']['MeetmeList'])) { |
|
1446 | + if (!isset($conf_data['data']['MeetmeList'])) { |
|
1447 | 1447 | return $result; |
1448 | 1448 | } |
1449 | 1449 | foreach ($conf_data['data']['MeetmeList'] as $user_data) { |
@@ -373,7 +373,8 @@ discard block |
||
373 | 373 | * Читает данные из сокета. Если возникает ошибка возвращает ее. |
374 | 374 | * @return array |
375 | 375 | */ |
376 | - private function getDataFromSocket() { |
|
376 | + private function getDataFromSocket() |
|
377 | + { |
|
377 | 378 | $response = []; |
378 | 379 | if(!is_resource($this->socket)){ |
379 | 380 | $response['error'] = 'Socket not init.'; |
@@ -384,11 +385,11 @@ discard block |
||
384 | 385 | if($resultFgets !== false){ |
385 | 386 | $buffer = trim($resultFgets); |
386 | 387 | $response['data'] = $buffer; |
387 | - }else{ |
|
388 | + } else{ |
|
388 | 389 | $response['error'] = 'Read data error.'; |
389 | 390 | } |
390 | 391 | |
391 | - }catch (Throwable $e){ |
|
392 | + } catch (Throwable $e){ |
|
392 | 393 | $response['error'] = $e->getMessage(); |
393 | 394 | } |
394 | 395 | |
@@ -399,7 +400,8 @@ discard block |
||
399 | 400 | * Читает данные из сокета |
400 | 401 | * @return string |
401 | 402 | */ |
402 | - private function getStringDataFromSocket() { |
|
403 | + private function getStringDataFromSocket() |
|
404 | + { |
|
403 | 405 | $response = $this->getDataFromSocket(); |
404 | 406 | return $response['data'] ?? ''; |
405 | 407 | } |
@@ -419,7 +421,7 @@ discard block |
||
419 | 421 | if($resultWrite === false){ |
420 | 422 | $result = false; |
421 | 423 | } |
422 | - }catch (Throwable $e){ |
|
424 | + } catch (Throwable $e){ |
|
423 | 425 | $result = false; |
424 | 426 | } |
425 | 427 | return $result; |