Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Nall-chan committed Oct 24, 2024
1 parent 7c03c74 commit 3d22300
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 35 deletions.
2 changes: 1 addition & 1 deletion ONVIF Configurator/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![SDK](https://img.shields.io/badge/Symcon-PHPModul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Version](https://img.shields.io/badge/Modul%20Version-2.20-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Modul%20Version-2.21-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Symcon%20Version-7.0%20%3E-green.svg)](https://www.symcon.de/service/dokumentation/installation/migrationen/v60-v61-q1-2022/)
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Check Style](https://github.com/Nall-chan/ONVIF/workflows/Check%20Style/badge.svg)](https://github.com/Nall-chan/ONVIF/actions)
Expand Down
2 changes: 1 addition & 1 deletion ONVIF Digital Input/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![SDK](https://img.shields.io/badge/Symcon-PHPModul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Version](https://img.shields.io/badge/Modul%20Version-2.20-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Modul%20Version-2.21-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Symcon%20Version-7.0%20%3E-green.svg)](https://www.symcon.de/service/dokumentation/installation/migrationen/v60-v61-q1-2022/)
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Check Style](https://github.com/Nall-chan/ONVIF/workflows/Check%20Style/badge.svg)](https://github.com/Nall-chan/ONVIF/actions)
Expand Down
2 changes: 1 addition & 1 deletion ONVIF Digital Output/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![SDK](https://img.shields.io/badge/Symcon-PHPModul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Version](https://img.shields.io/badge/Modul%20Version-2.20-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Modul%20Version-2.21-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Symcon%20Version-7.0%20%3E-green.svg)](https://www.symcon.de/service/dokumentation/installation/migrationen/v60-v61-q1-2022/)
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Check Style](https://github.com/Nall-chan/ONVIF/workflows/Check%20Style/badge.svg)](https://github.com/Nall-chan/ONVIF/actions)
Expand Down
2 changes: 1 addition & 1 deletion ONVIF Discovery/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![SDK](https://img.shields.io/badge/Symcon-PHPModul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Version](https://img.shields.io/badge/Modul%20Version-2.20-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Modul%20Version-2.21-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Symcon%20Version-7.0%20%3E-green.svg)](https://www.symcon.de/service/dokumentation/installation/migrationen/v60-v61-q1-2022/)
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Check Style](https://github.com/Nall-chan/ONVIF/workflows/Check%20Style/badge.svg)](https://github.com/Nall-chan/ONVIF/actions)
Expand Down
4 changes: 2 additions & 2 deletions ONVIF Discovery/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ protected function DiscoverDevices(): array
}
$this->SendDebug('Receive', $response, 0);
$xml = new DOMDocument();
if (false === $xml->loadXML($response)) {
if (false === @$xml->loadXML($response)) {
$this->SendDebug('Error on parse XML', $response, 0);
continue;
}
Expand Down Expand Up @@ -298,7 +298,7 @@ protected function DiscoverDevices(): array
}
$this->SendDebug('Receive', $response, 0);
$xml = new DOMDocument();
if (false === $xml->loadXML($response)) {
if (false === @$xml->loadXML($response)) {
$this->SendDebug('Error on parse XML', $response, 0);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion ONVIF Events/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![SDK](https://img.shields.io/badge/Symcon-PHPModul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Version](https://img.shields.io/badge/Modul%20Version-2.20-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Modul%20Version-2.21-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Symcon%20Version-7.0%20%3E-green.svg)](https://www.symcon.de/service/dokumentation/installation/migrationen/v60-v61-q1-2022/)
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Check Style](https://github.com/Nall-chan/ONVIF/workflows/Check%20Style/badge.svg)](https://github.com/Nall-chan/ONVIF/actions)
Expand Down
2 changes: 1 addition & 1 deletion ONVIF IO/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![SDK](https://img.shields.io/badge/Symcon-PHPModul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Version](https://img.shields.io/badge/Modul%20Version-2.20-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Modul%20Version-2.21-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Symcon%20Version-7.0%20%3E-green.svg)](https://www.symcon.de/service/dokumentation/installation/migrationen/v60-v61-q1-2022/)
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Check Style](https://github.com/Nall-chan/ONVIF/workflows/Check%20Style/badge.svg)](https://github.com/Nall-chan/ONVIF/actions)
Expand Down
61 changes: 49 additions & 12 deletions ONVIF IO/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ protected function StartConnection()
$AllEventProperties = array_merge($AllEventProperties, $SupportedRuleTopicData);
}
}
//$this->SendData($XAddr[\ONVIF\NS::Analytics], \ONVIF\WSDL::Analytics, 'GetRules', true); VideoAnalyticsConfiguration
//$this->SendData($XAddr[\ONVIF\NS::Analytics], \ONVIF\WSDL::Analytics, 'GetSupportedRules', true); Video Analytics configuration
} else {
if (count($AnalyticsTokens)) {
$this->Warnings = array_merge($this->Warnings, [$this->Translate('Analytics events could not be retrieved. The device reported AnalyticsTokens, but the Analytics namespace and XAddr were not reported!')]);
Expand Down Expand Up @@ -1268,7 +1270,7 @@ protected function SetSynchronizationPoint(): bool
{
$SubscriptionReference = $this->ReadAttributeString(\ONVIF\IO\Attribute::SubscriptionReference);
if ($SubscriptionReference == '') {
$this->SendDebug('ERROR SetSynchronizationPoint', 'No SubscriptionReference', 0);
$this->SendDebug('ERROR ' . __FUNCTION__, 'No SubscriptionReference', 0);
$this->LogMessage($this->Translate('Call SetSynchronizationPoint with no SubscriptionReference'), KL_ERROR);
return false;
}
Expand All @@ -1277,7 +1279,12 @@ protected function SetSynchronizationPoint(): bool
$SubscriptionId = $this->ReadAttributeString(\ONVIF\IO\Attribute::SubscriptionId);
if ($SubscriptionId != '') {
$xml = new DOMDocument();
$xml->loadXML($SubscriptionId);
$validXML = @$xml->loadXML($SubscriptionId);
if (!$validXML) {
$this->LogMessage($this->Translate('Malformed XML in ' . __FUNCTION__ . ' received'), KL_ERROR);
$this->SendDebug('ERROR ' . __FUNCTION__, $this->Translate('Malformed XML received'), 0);
return false;
}
$ns = $xml->firstChild->namespaceURI;
$name = $xml->firstChild->nodeName;
$Header[] = new SoapHeader($ns, $name, new SoapVar($SubscriptionId, XSD_ANYXML), true);
Expand All @@ -1300,7 +1307,7 @@ protected function Renew(): bool
$this->lock(\ONVIF\IO\Property::EventHandler);
$SubscriptionReference = $this->ReadAttributeString(\ONVIF\IO\Attribute::SubscriptionReference);
if ($SubscriptionReference == '') {
$this->SendDebug('ERROR Renew', 'No SubscriptionReference', 0);
$this->SendDebug('ERROR ' . __FUNCTION__, 'No SubscriptionReference', 0);
$this->LogMessage($this->Translate('Call Renew with no SubscriptionReference'), KL_ERROR);
$this->unlock(\ONVIF\IO\Property::EventHandler);
return false;
Expand All @@ -1310,7 +1317,13 @@ protected function Renew(): bool
$SubscriptionId = $this->ReadAttributeString(\ONVIF\IO\Attribute::SubscriptionId);
if ($SubscriptionId != '') {
$xml = new DOMDocument();
$xml->loadXML($SubscriptionId);
$validXML = @$xml->loadXML($SubscriptionId);
if (!$validXML) {
$this->LogMessage($this->Translate('Malformed XML in ' . __FUNCTION__ . ' received'), KL_ERROR);
$this->SendDebug('ERROR ' . __FUNCTION__, $this->Translate('Malformed XML received'), 0);
$this->unlock(\ONVIF\IO\Property::EventHandler);
return false;
}
$ns = $xml->firstChild->namespaceURI;
$name = $xml->firstChild->nodeName;
$Header[] = new SoapHeader($ns, $name, new SoapVar($SubscriptionId, XSD_ANYXML), true);
Expand All @@ -1329,7 +1342,7 @@ protected function Renew(): bool
return false;
}
if (!is_object($RenewResult)) {
$this->SendDebug('ERROR Renew', 'No Response', 0);
$this->SendDebug('ERROR ' . __FUNCTION__, 'No Response', 0);
$this->LogMessage($this->Translate('Error Renew with no Response'), KL_ERROR);
$this->SetStatus(IS_EBASE + 3);
$this->isSubscribed = false;
Expand Down Expand Up @@ -1365,7 +1378,13 @@ protected function Unsubscribe(): bool
$Header = $this->GenerateSOAPHeader($Action, $SubscriptionReference);
if ($SubscriptionId != '') {
$xml = new DOMDocument();
$xml->loadXML($SubscriptionId);
$validXML = @$xml->loadXML($SubscriptionId);
if (!$validXML) {
$this->LogMessage($this->Translate('Malformed XML in ' . __FUNCTION__ . ' received'), KL_ERROR);
$this->SendDebug('ERROR ' . __FUNCTION__, $this->Translate('Malformed XML received'), 0);
$this->unlock(\ONVIF\IO\Property::EventHandler);
return false;
}
$ns = $xml->firstChild->namespaceURI;
$name = $xml->firstChild->nodeName;
$Header[] = new SoapHeader($ns, $name, new SoapVar($SubscriptionId, XSD_ANYXML));
Expand All @@ -1392,7 +1411,12 @@ protected function GetEventProperties(): false|array
}

$xml = new DOMDocument();
$xml->loadXML($Response);
$validXML = @$xml->loadXML($Response);
if (!$validXML) {
$this->LogMessage($this->Translate('Malformed XML in ' . __FUNCTION__ . ' received'), KL_ERROR);
$this->SendDebug('ERROR ' . __FUNCTION__, $this->Translate('Malformed XML received'), 0);
return false;
}
$xpath = new DOMXPath($xml);
foreach (\ONVIF\NS::Namespaces as $NSKey => $Namespace) {
$EventNS[$NSKey] = $xml->lookupPrefix($Namespace);
Expand Down Expand Up @@ -1814,6 +1838,7 @@ protected function GetSupportedAnalyticsModules(string $AnalyticsToken): false|a
}
return $this->DecodeAnalyticsAndRuleResponse($Response);
}

protected function GetSupportedRules(string $AnalyticsToken): false|array
{
$XAddr = $this->ReadAttributeArray(\ONVIF\IO\Attribute::XAddr);
Expand All @@ -1827,10 +1852,16 @@ protected function GetSupportedRules(string $AnalyticsToken): false|array
}
return $this->DecodeAnalyticsAndRuleResponse($Response);
}

protected function DecodeAnalyticsAndRuleResponse(string $ResponseXML): array
{
$xml = new DOMDocument();
$xml->loadXML($ResponseXML);
$validXML = @$xml->loadXML($ResponseXML);
if (!$validXML) {
$this->LogMessage($this->Translate('Malformed XML in ' . __FUNCTION__ . ' received'), KL_ERROR);
$this->SendDebug('ERROR ' . __FUNCTION__, $this->Translate('Malformed XML received'), 0);
return [];
}
$xpath = new DOMXPath($xml);
foreach (\ONVIF\NS::Namespaces as $NSKey => $Namespace) {
$EventNS[$NSKey] = $xml->lookupPrefix($Namespace);
Expand All @@ -1851,6 +1882,7 @@ protected function DecodeAnalyticsAndRuleResponse(string $ResponseXML): array
}
return $TopicData;
}

protected function GetServices(): bool
{
$Params = [
Expand All @@ -1869,9 +1901,13 @@ protected function GetServices(): bool
}
$XAddr = $this->ReadAttributeArray(\ONVIF\IO\Attribute::XAddr);
$xml = new DOMDocument();
$xml->loadXML($Response);
$validXML = @$xml->loadXML($Response);
if (!$validXML) {
$this->LogMessage($this->Translate('Malformed XML in ' . __FUNCTION__ . ' received'), KL_ERROR);
$this->SendDebug('ERROR ' . __FUNCTION__, $this->Translate('Malformed XML received'), 0);
return false;
}
$xPath = new DOMXPath($xml);

foreach ($ServicesResult as $Service) {
$XAddr[$Service['Namespace']] = parse_url($Service['XAddr'], PHP_URL_PATH);
$NSKey = array_search($Service['Namespace'], \ONVIF\NS::Namespaces);
Expand Down Expand Up @@ -2178,8 +2214,9 @@ protected function ProcessHookData(): void
protected function DecodeNotificationMessage(string $NotificationMessageXML): bool
{
$xml = new DOMDocument();
$xml->loadXML($NotificationMessageXML);
if ($xml === false) {
/** @var mixed $validXML */
$validXML = @$xml->loadXML($NotificationMessageXML);
if (!$validXML) {
$this->LogMessage($this->Translate('Malformed XML event received'), KL_ERROR);
$this->SendDebug('Event', $this->Translate('Malformed XML event received'), 0);
return false;
Expand Down
2 changes: 1 addition & 1 deletion ONVIF Image Grabber/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![SDK](https://img.shields.io/badge/Symcon-PHPModul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Version](https://img.shields.io/badge/Modul%20Version-2.20-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Modul%20Version-2.21-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Symcon%20Version-7.0%20%3E-green.svg)](https://www.symcon.de/service/dokumentation/installation/migrationen/v60-v61-q1-2022/)
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Check Style](https://github.com/Nall-chan/ONVIF/workflows/Check%20Style/badge.svg)](https://github.com/Nall-chan/ONVIF/actions)
Expand Down
2 changes: 1 addition & 1 deletion ONVIF Media Stream/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![SDK](https://img.shields.io/badge/Symcon-PHPModul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Version](https://img.shields.io/badge/Modul%20Version-2.20-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Modul%20Version-2.21-blue.svg)](https://community.symcon.de/t/modul-onvif-profil-s-fuer-ip-kameras-und-encoder/52036)
[![Version](https://img.shields.io/badge/Symcon%20Version-7.0%20%3E-green.svg)](https://www.symcon.de/service/dokumentation/installation/migrationen/v60-v61-q1-2022/)
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Check Style](https://github.com/Nall-chan/ONVIF/workflows/Check%20Style/badge.svg)](https://github.com/Nall-chan/ONVIF/actions)
Expand Down
Loading

0 comments on commit 3d22300

Please sign in to comment.