ONVIF Connection is Broken

I’m creating an ONVIF server (profile G & S) but I’m getting some problems with its Milestone XProtect integration. While the server is being detected and I can add it without issues to the Recording Servers, I keep getting a generic ‘Connection is broken’ error

I’ve been using Wireshark to monitor all the exchanged messages, and while I did found some exceptions that I promptly fixed, currently none of the messages seem abnormal.

I also tested my server in other free ONVIF clients, and was able to access its streams and replays.

Is there anything else I can do to debug or get more information about this ‘Connection is broken’ error?

Quick check, have you seen this document? - https://doc.milestonesys.com/latest/en-US/portal/htm/chapter-page-onvifdriver.htm

Yes, I have seen the document.

Hello @Alaa Abouzeid

Does your server support different codecs/streaming methods (which ones?), and do you have this issue with all of them?

Have you checked in Wireshark if any attempt is being made to start the stream, i.e., a GetStreamURI request and response, followed by RTSP communication (DESCRIBE, SETUP, PLAY), and if so, where does the failure occur?

Do you see any errors in the driver logs written during that time (logs are located at [C:\ProgramData\Milestone\XProtect](file:C:/ProgramData/Milestone/XProtect) Recording Server\Logs\Drivers\ONVIF)?

Thanks for the response, I was able to find and fix several errors that were found in the logs. My issue still persists though.

There’s one error that is bugging me:

"The message with Action 'http://www.onvif.org/ver10/media/wsdl/GetAudioSourceConfigurations’ cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None)."

In the WSDL spec found in https://www.onvif.org/ver10/media/wsdl/media.wsdl , there seems to be a typo in http://www.onvif.org/ver10/media/wsdlGetAudioSourceConfigurations/ (a missing /), not sure if it’s related with my problem.

I’m also implementing both Media and Media2 services, but XProtect is always using Media. Is there any way of forcing the usage of Media2?

@Alaa Abouzeid​ by default the driver should always prioritize Media2; Please note that DeviceIO service is required for Media2, as stated in https://doc.milestonesys.com/latest/en-US/onvifdriver/media_service.htm?tocpath=Third-party%20integrations%7CONVIF%C2%AE%20drivers%7CDriver%20settings%7C_____4

As for the other issues that were reported (and possibly this, in case this information does not help), we will need to investigate - please provide a wireshark trace that captures adding the device to XProtect and the attempts to start the video stream, filtering by Device IP.

Here’s the wireshark.

And here are the logs

Hi @Alaa Abouzeid

Please check the Media Service version in the Settings tab for this Hardware. The warning in the log suggests it is currently set to 1, so it needs to be changed to 2.

Alternatively, you can delete all entries for this IP in the Devices.ini file and the driver should automatically choose Media2.

The Devices.ini is found at [C:\ProgramData\VideoDeviceDrivers\C_\Program](file:C:/ProgramData/VideoDeviceDrivers/C/Program) Files (x86)\Milestone\XProtect Recording Server\Drivers\NativeDrivers_

You will need to restart the RS or re-add the device in order for the new value to take effect.

If the issues persists after Media2 is correctly chosen, we will need some additional logs.

An odd thing is that i don’t see calls to GetPresets or GetOptions in the provided wireshark trace, but there are some related error logs. Not sure yet how this is related.

There are also no attempts to start a video stream.

But before that, please make sure that the device license is not expired, just in case. You can view the license details from the License Information Window: https://doc.milestonesys.com/latest/en-US/standard_features/sf_mc/sf_licensing/mc_licenseinformationpageui.htm

For the new logs, raise the driver logging level to DEBUG, by adding or editing the [logging] section in Devices.ini as follows:

[logging]
level=5
sink=3
 

Then restart the Recording Server so that the new level is reflected, and re-add the device (make sure to cleanup all entries for this IP in the .ini file before that). Gather a new wireshark trace that captures the re-adding, and collect the diagnostic logs - they will also include the driver logs.

You can refer to the diagnostics tool documentation: https://doc.milestonesys.com/latest/en-US/quick_guides/diagtool/_qg_diagtool_collectdefaults.htm?tocpath=Tools%20%2526%20Architecture%7CMilestone%20Diagnostics%20Tool%7CCollect%20logs%20and%20diagnostics%7C_____1

Deleted the entries in the Devices.ini and it’s now working, the message disappeared and the stream is now visible.

Thanks.

update latest device pack install after camera configuration

h.264 recording setup from camera