Merge branch 'master' into storageareas
This commit is contained in:
commit
e62ea454ba
|
@ -17,6 +17,14 @@ Build-Depends: debhelper (>= 9), cmake
|
|||
, libvlccore-dev, libvlc-dev
|
||||
, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev
|
||||
, libgcrypt11-dev, libpolkit-gobject-1-dev
|
||||
, libphp-serialization-perl
|
||||
, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, libdbd-mysql-perl
|
||||
, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl
|
||||
, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl
|
||||
, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl
|
||||
, libdata-dump-perl, libclass-std-fast-perl, libsoap-wsdl-perl, libio-socket-multicast-perl, libdigest-sha-perl
|
||||
, libsys-cpu-perl, libsys-meminfo-perl
|
||||
, libdata-uuid-perl
|
||||
Standards-Version: 3.9.4
|
||||
|
||||
Package: zoneminder
|
||||
|
@ -32,6 +40,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}
|
|||
, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl
|
||||
, libdata-dump-perl, libclass-std-fast-perl, libsoap-wsdl-perl, libio-socket-multicast-perl, libdigest-sha-perl
|
||||
, libsys-cpu-perl, libsys-meminfo-perl
|
||||
, libdata-uuid-perl
|
||||
, libpcre3
|
||||
, libav-tools, libavdevice53
|
||||
, rsyslog | system-log-daemon
|
||||
|
|
|
@ -21,6 +21,7 @@ Build-Depends: debhelper (>= 9), python-sphinx | python3-sphinx, apache2-dev, dh
|
|||
,libphp-serialization-perl
|
||||
,libsys-mmap-perl [!hurd-any]
|
||||
,libwww-perl
|
||||
,libdata-uuid-perl
|
||||
# Unbundled (dh_linktree):
|
||||
,libjs-jquery
|
||||
,libjs-mootools
|
||||
|
@ -50,6 +51,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}
|
|||
,libsys-mmap-perl [!hurd-any]
|
||||
,liburi-encode-perl
|
||||
,libwww-perl
|
||||
,libdata-uuid-perl
|
||||
,mysql-client | virtual-mysql-client
|
||||
,perl-modules
|
||||
,php5-mysql, php5-gd
|
||||
|
|
|
@ -22,6 +22,7 @@ Build-Depends: debhelper (>= 9), dh-systemd, python-sphinx | python3-sphinx, apa
|
|||
,libphp-serialization-perl
|
||||
,libsys-mmap-perl [!hurd-any]
|
||||
,libwww-perl
|
||||
,libdata-uuid-perl
|
||||
# Unbundled (dh_linktree):
|
||||
,libjs-jquery
|
||||
,libjs-mootools
|
||||
|
@ -54,6 +55,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}
|
|||
,libio-socket-multicast-perl
|
||||
,libdigest-sha-perl
|
||||
,libsys-cpu-perl, libsys-meminfo-perl
|
||||
,libdata-uuid-perl
|
||||
,mysql-client | virtual-mysql-client
|
||||
,perl-modules
|
||||
,php5-mysql | php-mysql, php5-gd | php-gd
|
||||
|
|
|
@ -61,7 +61,7 @@ sub _notify_response
|
|||
}
|
||||
|
||||
sub send_multi() {
|
||||
my ($self, $address, $port, $data) = @_;
|
||||
my ($self, $address, $port, $utf8_string) = @_;
|
||||
|
||||
my $destination = $address . ':' . $port;
|
||||
my $socket = IO::Socket::Multicast->new(PROTO => 'udp',
|
||||
|
@ -69,8 +69,11 @@ sub send_multi() {
|
|||
|
||||
or die 'Cannot open multicast socket to ' . ${address} . ':' . ${port};
|
||||
|
||||
my $bytes = $utf8_string;
|
||||
utf8::encode($bytes);
|
||||
|
||||
$socket->mcast_ttl(1);
|
||||
$socket->send($data);
|
||||
$socket->send($bytes);
|
||||
}
|
||||
|
||||
sub receive_multi() {
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
package WSDiscovery10::Elements::Header;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
||||
__PACKAGE__->_set_element_form_qualified(0);
|
||||
|
||||
sub get_xmlns { 'http://schemas.xmlsoap.org/soap/envelope/' };
|
||||
|
||||
our $XML_ATTRIBUTE_CLASS;
|
||||
undef $XML_ATTRIBUTE_CLASS;
|
||||
|
||||
sub __get_attr_class {
|
||||
return $XML_ATTRIBUTE_CLASS;
|
||||
}
|
||||
|
||||
use Class::Std::Fast::Storable constructor => 'none';
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||
|
||||
Class::Std::initialize();
|
||||
|
||||
{ # BLOCK to scope variables
|
||||
|
||||
my %Action_of :ATTR(:get<Action>);
|
||||
my %MessageID_of :ATTR(:get<MessageID>);
|
||||
my %ReplyTo_of :ATTR(:get<ReplyTo>);
|
||||
my %To_of :ATTR(:get<To>);
|
||||
|
||||
__PACKAGE__->_factory(
|
||||
[ qw( Action MessageID ReplyTo To ) ],
|
||||
{
|
||||
'Action' => \%Action_of,
|
||||
'MessageID' => \%MessageID_of,
|
||||
'ReplyTo' => \%ReplyTo_of,
|
||||
'To' => \%To_of,
|
||||
},
|
||||
{
|
||||
'Action' => 'WSDiscovery10::Elements::Action',
|
||||
'MessageID' => 'WSDiscovery10::Elements::MessageID',
|
||||
'ReplyTo' => 'WSDiscovery10::Elements::ReplyTo',
|
||||
'To' => 'WSDiscovery10::Elements::To',
|
||||
},
|
||||
{
|
||||
'Action' => '',
|
||||
'MessageID' => '',
|
||||
'ReplyTo' => '',
|
||||
'To' => '',
|
||||
}
|
||||
);
|
||||
|
||||
} # end BLOCK
|
||||
|
||||
|
||||
1;
|
|
@ -34,6 +34,10 @@ sub ProbeOp {
|
|||
|
||||
},
|
||||
header => {
|
||||
'use' => 'literal',
|
||||
namespace => 'http://schemas.xmlsoap.org/ws/2004/08/addressing',
|
||||
encodingStyle => '',
|
||||
parts => [qw( WSDiscovery10::Elements::Header )],
|
||||
|
||||
},
|
||||
headerfault => {
|
||||
|
|
|
@ -23,7 +23,12 @@ our $typemap_1 = {
|
|||
'ProbeMatches/ProbeMatch/Types' => 'WSDiscovery10::Types::QNameListType',
|
||||
'ProbeMatches/ProbeMatch/EndpointReference' => 'WSDiscovery10::Types::EndpointReferenceType',
|
||||
'ProbeMatches/ProbeMatch/EndpointReference/ReferenceProperties' => 'WSDiscovery10::Types::ReferencePropertiesType',
|
||||
'ProbeMatches/ProbeMatch/EndpointReference/PortType' => 'WSDiscovery10::Types::AttributedQName'
|
||||
'ProbeMatches/ProbeMatch/EndpointReference/PortType' => 'WSDiscovery10::Types::AttributedQName',
|
||||
'MessageID' => '__SKIP__',
|
||||
'RelatesTo' => '__SKIP__',
|
||||
'To' => '__SKIP__',
|
||||
'Action' => '__SKIP__',
|
||||
'AppSequence' => '__SKIP__',
|
||||
};
|
||||
;
|
||||
|
||||
|
|
|
@ -7,8 +7,10 @@ __PACKAGE__->_set_element_form_qualified(0);
|
|||
|
||||
sub get_xmlns { 'http://schemas.xmlsoap.org/ws/2005/04/discovery' };
|
||||
|
||||
our $XML_ATTRIBUTE_CLASS;
|
||||
undef $XML_ATTRIBUTE_CLASS;
|
||||
our $XML_ATTRIBUTE_CLASS = 'WSDiscovery10::Types::ProbeType::_ProbeType::XmlAttr';
|
||||
|
||||
#our $XML_ATTRIBUTE_CLASS;
|
||||
#undef $XML_ATTRIBUTE_CLASS;
|
||||
|
||||
sub __get_attr_class {
|
||||
return $XML_ATTRIBUTE_CLASS;
|
||||
|
@ -49,11 +51,55 @@ __PACKAGE__->_factory(
|
|||
} # end BLOCK
|
||||
|
||||
|
||||
package WSDiscovery10::Types::ProbeType::_ProbeType::XmlAttr;
|
||||
#use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||
use Class::Std::Fast::Storable constructor => 'none', cache => 1;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
|
||||
{ # BLOCK to scope variables
|
||||
|
||||
my %Attribs_of :ATTR(:get<Attribs>);
|
||||
|
||||
sub new
|
||||
{
|
||||
my $self = pop @{ Class::Std::Fast::OBJECT_CACHE_REF()->{ $_[0] } };
|
||||
$self = bless \(my $o = Class::Std::Fast::ID()), $_[0]
|
||||
if not defined $self;
|
||||
|
||||
$self->BUILD(${$self}, $_[1]);
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub BUILD
|
||||
{
|
||||
my ($self, $ident, $arg_ref) = @_;
|
||||
|
||||
$Attribs_of{$ident} = $arg_ref;
|
||||
}
|
||||
|
||||
# without this no attributes are serialized
|
||||
# SOAP::WSDL::XSD::Typelib::CompexType sub serialize_attr()
|
||||
|
||||
sub as_bool :BOOLIFY { 1 }
|
||||
|
||||
sub serialize()
|
||||
{
|
||||
my $ident = ${ $_[0] };
|
||||
my $option_ref = $_[1];
|
||||
my $attr_str = "";
|
||||
|
||||
foreach my $attr (keys %{$Attribs_of{$ident}})
|
||||
{
|
||||
my $value = %{$Attribs_of{$ident}}{$attr};
|
||||
$attr_str .= " $attr=\"$value\"";
|
||||
}
|
||||
|
||||
return $attr_str;
|
||||
}
|
||||
|
||||
} # end BLOCK
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
@ -25,13 +25,14 @@
|
|||
#
|
||||
|
||||
use Getopt::Std;
|
||||
use Data::UUID;
|
||||
|
||||
require ONVIF::Client;
|
||||
|
||||
require WSDiscovery10::Interfaces::WSDiscovery::WSDiscoveryPort;
|
||||
require WSDiscovery10::Elements::Header;
|
||||
require WSDiscovery10::Elements::Types;
|
||||
require WSDiscovery10::Elements::Scopes;
|
||||
require WSDiscovery10::Elements::To;
|
||||
|
||||
require WSDiscovery::TransportUDP;
|
||||
|
||||
|
@ -169,6 +170,8 @@ sub discover
|
|||
## try both soap versions
|
||||
my %services;
|
||||
|
||||
my $uuid_gen = Data::UUID->new();
|
||||
|
||||
if($verbose) {
|
||||
print "Probing for SOAP 1.1\n"
|
||||
}
|
||||
|
@ -177,12 +180,18 @@ sub discover
|
|||
});
|
||||
$svc_discover->set_soap_version('1.1');
|
||||
|
||||
my $uuid = $uuid_gen->create_str();
|
||||
|
||||
my $result = $svc_discover->ProbeOp(
|
||||
{ # WSDiscovery::Types::ProbeType
|
||||
Types => 'http://www.onvif.org/ver10/network/wsdl:NetworkVideoTransmitter http://www.onvif.org/ver10/device/wsdl:Device', # QNameListType
|
||||
Scopes => { value => '' },
|
||||
},
|
||||
WSDiscovery10::Elements::To->new({ value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' })
|
||||
WSDiscovery10::Elements::Header->new({
|
||||
Action => { value => 'http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe' },
|
||||
MessageID => { value => "urn:uuid:$uuid" },
|
||||
To => { value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' },
|
||||
})
|
||||
);
|
||||
# print $result . "\n";
|
||||
|
||||
|
@ -197,12 +206,22 @@ sub discover
|
|||
});
|
||||
$svc_discover->set_soap_version('1.2');
|
||||
|
||||
# copies of the same Probe message must have the same MessageID.
|
||||
# This is not a copy. So we generate a new uuid.
|
||||
$uuid = $uuid_gen->create_str();
|
||||
|
||||
$result = $svc_discover->ProbeOp(
|
||||
{ # WSDiscovery::Types::ProbeType
|
||||
Types => 'http://www.onvif.org/ver10/network/wsdl:NetworkVideoTransmitter http://www.onvif.org/ver10/device/wsdl:Device', # QNameListType
|
||||
xmlattr => { 'xmlns:dn' => 'http://www.onvif.org/ver10/network/wsdl',
|
||||
'xmlns:tds' => 'http://www.onvif.org/ver10/device/wsdl', },
|
||||
Types => 'dn:NetworkVideoTransmitter tds:Device', # QNameListType
|
||||
Scopes => { value => '' },
|
||||
},
|
||||
WSDiscovery10::Elements::To->new({ value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' })
|
||||
WSDiscovery10::Elements::Header->new({
|
||||
Action => { value => 'http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe' },
|
||||
MessageID => { value => "urn:uuid:$uuid" },
|
||||
To => { value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' },
|
||||
})
|
||||
);
|
||||
# print $result . "\n";
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
define( "MSG_TIMEOUT", 2.0 );
|
||||
define( "MSG_DATA_SIZE", 4+256 );
|
||||
|
||||
|
@ -35,8 +34,7 @@ if ( canEdit( 'Monitors' ) )
|
|||
}
|
||||
}
|
||||
ajaxResponse( exec( escapeshellcmd( $zmuCommand ) ) );
|
||||
} else {
|
||||
ajaxError( 'Insufficient permissions' );
|
||||
}
|
||||
|
||||
ajaxError( 'Unrecognised action or insufficient permissions' );
|
||||
|
||||
?>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue