Skip to content

Commit 9b43e73

Browse files
Do renew regardless of wsa
1 parent b323c48 commit 9b43e73

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/zm_monitor_onvif.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,9 @@ void Monitor::ONVIF::WaitForMessage() {
474474
} // end scope for lock
475475

476476
// we renew the current subscription .........
477+
set_credentials(soap);
478+
wsnt__Renew.TerminationTime = &subscription_timeout;
477479
if (use_wsa) {
478-
set_credentials(soap);
479-
wsnt__Renew.TerminationTime = &subscription_timeout;
480480
RequestMessageID = soap_wsa_rand_uuid(soap);
481481
if (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "RenewRequest") == SOAP_OK) {
482482
Debug(2, "ONVIF: WS-Addressing headers set for Renew");
@@ -496,6 +496,18 @@ void Monitor::ONVIF::WaitForMessage() {
496496
RequestMessageID, response.SubscriptionReference.Address, soap->error, soap_fault_string(soap), soap_fault_detail(soap));
497497
healthy = false;
498498
} // end renew
499+
} else {
500+
if (proxyEvent.Renew(response.SubscriptionReference.Address, nullptr, &wsnt__Renew, wsnt__RenewResponse) != SOAP_OK) {
501+
Error("ONVIF: Couldn't do Renew! Error %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap));
502+
if (soap->error==12) {//ActionNotSupported
503+
healthy = true;
504+
} else {
505+
healthy = false;
506+
}
507+
} else {
508+
Debug(2, "ONVIF: Good Renew %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap));
509+
healthy = true;
510+
}
499511
}
500512
} // end if SOAP OK/NOT OK
501513
#endif

0 commit comments

Comments
 (0)