diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp
index e7d593d45..ac64e6f67 100644
--- a/src/zm_monitor.cpp
+++ b/src/zm_monitor.cpp
@@ -104,7 +104,7 @@ std::string load_monitor_sql =
"`MotionFrameSkip`, "
"`FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`, "
"`Latitude`, `Longitude`, "
-"`RTSPServer`, `RTSPStreamName`, `ONVIF_Alarm_Text`,"
+"`RTSPServer`, `RTSPStreamName`, `SOAP_wsa_compl`, `ONVIF_Alarm_Text`,"
"`ONVIF_URL`, `ONVIF_Username`, `ONVIF_Password`, `ONVIF_Options`, "
"`ONVIF_Event_Listener`, `use_Amcrest_API`,"
"`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1, ZoneCount "
@@ -257,6 +257,7 @@ Monitor::Monitor() :
longitude(0.0),
rtsp_server(false),
rtsp_streamname(""),
+ soap_wsa_compl(false),
onvif_alarm_txt(""),
importance(0),
zone_count(0),
@@ -361,7 +362,7 @@ Monitor::Monitor() :
"ImageBufferCount, `MaxImageBufferCount`, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, "
"SectionLength, MinSectionLength, FrameSkip, MotionFrameSkip, "
"FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif,"
- "`RTSPServer`,`RTSPStreamName`,
+ "`RTSPServer`, `RTSPStreamName`, `SOAP_wsa_compl`,"
"`ONVIF_URL`, `ONVIF_Username`, `ONVIF_Password`, `ONVIF_Options`, `ONVIF_Event_Listener`, `use_Amcrest_API`, "
"SignalCheckPoints, SignalCheckColour, Importance-1, ZoneCount, `MQTT_Enabled`, `MQTT_Subscriptions` FROM Monitors";
*/
@@ -553,6 +554,8 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) {
/* "`RTSPServer`,`RTSPStreamName`, */
rtsp_server = (*dbrow[col] != '0'); col++;
rtsp_streamname = dbrow[col]; col++;
+ // get soap_wsa_compliance value
+ soap_wsa_compl = (*dbrow[col] != '0'); col++;
// get alarm text from table.
onvif_alarm_txt = std::string(dbrow[col] ? dbrow[col] : ""); col++;
@@ -1072,15 +1075,15 @@ bool Monitor::connect() {
soap->send_timeout = 0;
//soap->bind_flags |= SO_REUSEADDR;
soap_register_plugin(soap, soap_wsse);
- soap_register_plugin(soap, soap_wsa);
+ if (soap_wsa_compl) {soap_register_plugin(soap, soap_wsa);}
proxyEvent = PullPointSubscriptionBindingProxy(soap);
if (!onvif_url.empty()) {
std::string full_url = onvif_url + "/Events";
proxyEvent.soap_endpoint = full_url.c_str();
set_credentials(soap);
- const char *RequestMessageID = soap_wsa_rand_uuid(soap);
- if (soap_wsa_request(soap, RequestMessageID, proxyEvent.soap_endpoint , "CreatePullPointSubscriptionRequest") == SOAP_OK) {
+ const char *RequestMessageID = soap_wsa_compl ? soap_wsa_rand_uuid(soap) : "RequestMessageID";
+ if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, proxyEvent.soap_endpoint , "CreatePullPointSubscriptionRequest") == SOAP_OK)) {
Debug(1, "ONVIF Endpoint: %s", proxyEvent.soap_endpoint);
if (proxyEvent.CreatePullPointSubscription(&request, response) != SOAP_OK) {
const char *detail = soap_fault_detail(soap);
@@ -1095,8 +1098,8 @@ bool Monitor::connect() {
} else {
//Empty the stored messages
set_credentials(soap);
- RequestMessageID = soap_wsa_rand_uuid(soap);
- if (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address , "PullMessageRequest") == SOAP_OK) {
+ RequestMessageID = soap_wsa_compl ? soap_wsa_rand_uuid(soap):NULL;
+ if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address , "PullMessageRequest") == SOAP_OK)) {
Debug(1, "ONVIF :soap_wsa_request OK ");
if ((proxyEvent.PullMessages(response.SubscriptionReference.Address, NULL, &tev__PullMessages, tev__PullMessagesResponse) != SOAP_OK) &&
(soap->error != SOAP_EOF)
@@ -1113,30 +1116,32 @@ bool Monitor::connect() {
}
// we renew the current subscription .........
- set_credentials(soap);
- RequestMessageID = soap_wsa_rand_uuid(soap);
- if (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "RenewRequest") == SOAP_OK) {
- Debug(1, "ONVIF :soap_wsa_request OK");
- if (proxyEvent.Renew(response.SubscriptionReference.Address, NULL, &wsnt__Renew, wsnt__RenewResponse) != SOAP_OK) {
- Error("ONVIF Couldn't do initial Renew ! Error %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap));
- if (soap->error==12) {//ActionNotSupported
- Event_Poller_Healthy = true;
+ if (soap_wsa_compl){
+ set_credentials(soap);
+ RequestMessageID = soap_wsa_rand_uuid(soap);
+ if (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "RenewRequest") == SOAP_OK) {
+ Debug(1, "ONVIF :soap_wsa_request OK");
+ if (proxyEvent.Renew(response.SubscriptionReference.Address, NULL, &wsnt__Renew, wsnt__RenewResponse) != SOAP_OK) {
+ Error("ONVIF Couldn't do initial Renew ! Error %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap));
+ if (soap->error==12) {//ActionNotSupported
+ Event_Poller_Healthy = true;
+ } else {
+ Event_Poller_Healthy = false;
+ }
} else {
- Event_Poller_Healthy = false;
+ Debug(1, "Good Initial ONVIF Renew %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap));
+ Event_Poller_Healthy = true;
}
} else {
- Debug(1, "Good Initial ONVIF Renew %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap));
- Event_Poller_Healthy = true;
- }
- } else {
- Error("ONVIF Couldn't set wsa headers RequestMessageID=%s; TO=%s; Request=RenewRequest Error %i %s, %s",
- RequestMessageID,
- response.SubscriptionReference.Address,
- soap->error,
- soap_fault_string(soap),
- soap_fault_detail(soap));
- Event_Poller_Healthy = false;
- }
+ Error("ONVIF Couldn't set wsa headers RequestMessageID=%s; TO=%s; Request=RenewRequest Error %i %s, %s",
+ RequestMessageID,
+ response.SubscriptionReference.Address,
+ soap->error,
+ soap_fault_string(soap),
+ soap_fault_detail(soap));
+ Event_Poller_Healthy = false;
+ }// end renew
+ }
}
} else {
Error("ONVIF Couldn't set wsa headers RequestMessageID=%s; TO=%s; Request=CreatePullPointSubscriptionRequest Error %i %s, %s",
@@ -1844,8 +1849,8 @@ bool Monitor::Poll() {
} else {
#ifdef WITH_GSOAP
set_credentials(soap);
- const char *RequestMessageID = soap_wsa_rand_uuid(soap);
- if (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "PullMessageRequest") == SOAP_OK) {
+ const char *RequestMessageID = soap_wsa_compl ? soap_wsa_rand_uuid(soap) : "RequestMessageID";
+ if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "PullMessageRequest") == SOAP_OK)) {
Debug(1, ":soap_wsa_request OK; starting ONVIF PullMessageRequest ...");
int result = proxyEvent.PullMessages(response.SubscriptionReference.Address, NULL, &tev__PullMessages, tev__PullMessagesResponse);
if (result != SOAP_OK) {
@@ -1892,28 +1897,30 @@ bool Monitor::Poll() {
} // end foreach msg
// we renew the current subscription .........
- set_credentials(soap);
- std::string Termination_time = "PT60S";
- wsnt__Renew.TerminationTime = &Termination_time;
- RequestMessageID = soap_wsa_rand_uuid(soap);
- if (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "RenewRequest") == SOAP_OK) {
- Debug(1, ":soap_wsa_request OK");
- if (proxyEvent.Renew(response.SubscriptionReference.Address, NULL, &wsnt__Renew, wsnt__RenewResponse) != SOAP_OK) {
- Error("Couldn't do Renew! Error %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap));
- if (soap->error==12) {//ActionNotSupported
- Event_Poller_Healthy = true;
+ if (soap_wsa_compl){
+ set_credentials(soap);
+ std::string Termination_time = "PT60S";
+ wsnt__Renew.TerminationTime = &Termination_time;
+ RequestMessageID = soap_wsa_compl ? soap_wsa_rand_uuid(soap) : "RequestMessageID";
+ if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "RenewRequest") == SOAP_OK)) {
+ Debug(1, ":soap_wsa_request OK");
+ if (proxyEvent.Renew(response.SubscriptionReference.Address, NULL, &wsnt__Renew, wsnt__RenewResponse) != SOAP_OK) {
+ Error("Couldn't do Renew! Error %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap));
+ if (soap->error==12) {//ActionNotSupported
+ Event_Poller_Healthy = true;
+ } else {
+ Event_Poller_Healthy = false;
+ }
} else {
- Event_Poller_Healthy = false;
+ Debug(1, "Good Renew ONVIF Renew %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap));
+ Event_Poller_Healthy = true;
}
} else {
- Debug(1, "Good Renew ONVIF Renew %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap));
- Event_Poller_Healthy = true;
- }
- } else {
- Error("Couldn't set wsa headers RequestMessageID=%s; TO=%s; Request= RenewRequest .... ! Error %i %s, %s",
- RequestMessageID, response.SubscriptionReference.Address, soap->error, soap_fault_string(soap), soap_fault_detail(soap));
- Event_Poller_Healthy = false;
- }
+ Error("Couldn't set wsa headers RequestMessageID=%s; TO=%s; Request= RenewRequest .... ! Error %i %s, %s",
+ RequestMessageID, response.SubscriptionReference.Address, soap->error, soap_fault_string(soap), soap_fault_detail(soap));
+ Event_Poller_Healthy = false;
+ } // end renew
+ }
} // end if SOAP OK/NOT OK
} else {
Error("Couldn't set wsa headers RequestMessageID= %s ; TO= %s ; Request= PullMessageRequest .... ! Error %i %s, %s",
@@ -3480,8 +3487,8 @@ int Monitor::Close() {
Debug(1, "Tearing Down Onvif");
_wsnt__Unsubscribe wsnt__Unsubscribe;
_wsnt__UnsubscribeResponse wsnt__UnsubscribeResponse;
- const char *RequestMessageID = soap_wsa_rand_uuid(soap);
- if (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "UnsubscribeRequest") == SOAP_OK)
+ const char *RequestMessageID = soap_wsa_compl ? soap_wsa_rand_uuid(soap) : "RequestMessageID";
+ if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "UnsubscribeRequest") == SOAP_OK))
{
proxyEvent.Unsubscribe(response.SubscriptionReference.Address, NULL, &wsnt__Unsubscribe, wsnt__UnsubscribeResponse);
} else {
diff --git a/src/zm_monitor.h b/src/zm_monitor.h
index 840293321..0f7e8766d 100644
--- a/src/zm_monitor.h
+++ b/src/zm_monitor.h
@@ -505,6 +505,7 @@ protected:
double longitude;
bool rtsp_server; // Whether to include this monitor as an rtsp server stream
std::string rtsp_streamname; // path in the rtsp url for this monitor
+ bool soap_wsa_compl; // Whether the camera supports soap_wsa or not.
std::string onvif_alarm_txt; // def onvif_alarm_txt
int importance; // Importance of this monitor, affects Connection logging errors.
unsigned int zone_count;
diff --git a/web/includes/Monitor.php b/web/includes/Monitor.php
index 862128c67..e95ca311e 100644
--- a/web/includes/Monitor.php
+++ b/web/includes/Monitor.php
@@ -251,6 +251,7 @@ public static function getStatuses() {
'Longitude' => null,
'RTSPServer' => array('type'=>'boolean', 'default'=>0),
'RTSPStreamName' => '',
+ 'SOAP_wsa_compl' => array('type'=>'boolean', 'default'=>0),
'Importance' => 'Normal',
'MQTT_Enabled' => array('type'=>'boolean','default'=>0),
'MQTT_Subscriptions' => '',
diff --git a/web/includes/actions/monitor.php b/web/includes/actions/monitor.php
index 970c23fa2..b838cf805 100644
--- a/web/includes/actions/monitor.php
+++ b/web/includes/actions/monitor.php
@@ -111,7 +111,8 @@ if ($action == 'save') {
'LinkedMonitors' => array(),
'MQTT_Enabled' => 0,
'RTSPServer' => 0,
- 'SectionLengthWarn' => 0
+ 'SectionLengthWarn' => 0,
+ 'SOAP_wsa_compl' => 0
);
# Checkboxes don't return an element in the POST data, so won't be present in newMonitor.
diff --git a/web/lang/en_gb.php b/web/lang/en_gb.php
index dd2b9a25d..1ad00d43a 100644
--- a/web/lang/en_gb.php
+++ b/web/lang/en_gb.php
@@ -954,6 +954,14 @@ None: No frames will be decoded, live view and thumbnails will not be available~
You will get errors in your logs about this. So make sure your keyframe interval is low or you have enough ram.
'
),
+// Help for soap_wsa issue with chinesse cameras
+ 'OPTIONS_SOAP_wsa' => array(
+ 'Help' => '
+ Disable it if you receive an error ~~~ Couldnt do Renew Error 12 ActionNotSupported
+