mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-23 23:08:23 -04:00
Deal with structure of json response from API when getting Janus_Pin
This commit is contained in:
1 parent
f5bdbcf0bd
commit
8d56949800
1 file changed
+1
-2
@@ -279,9 +279,8 @@ public static function getStatuses() {
|
||||
return $output ? trim($output) : $output;
|
||||
} else if ($this->ServerId()) {
|
||||
$result = $this->Server()->SendToApi('/monitors/'.$this->{'Id'}.'.json');
|
||||
Debug(print_r($result, true));
|
||||
$json = json_decode($result, true);
|
||||
return $json['Janus_Pin'];
|
||||
return ((isset($json['monitor']) and isset($json['monitor']['Monitor']) and isset($json['monitor']['Monitor']['Janus_Pin'])) ? $json['monitor']['Monitor']['Janus_Pin'] : '');
|
||||
} else {
|
||||
Error('Server not assigned to Monitor in a multi-server setup. Please assign a server to the Monitor.');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user