bluecherrydvr / bluecherry-apps

Bluecherry surveillance system (server application)
http://www.bluecherrydvr.com
GNU General Public License v2.0
211 stars 68 forks source link

Feature/645 Test devices authentication #673

Closed JahleelAbraham closed 6 months ago

JahleelAbraham commented 6 months ago

Issue #645 requests that a feature be added to the Web UI that allows the end user to test and preview the connection status the their devices in an effort to make it more obvious when authentication settings and paths are not correct.

This PR contains changes to the editip stack (/templates/ajax/editip.php, /templates/dist/js/editip.js, /ajax/editip.php) and the function already contained within lib.php titled checkConnection().

This function previously incorrectly made a request for the header data of http URLs and assumed a 200 code would mean that the authentication succeeded. This was not the case. These have been substituted for an ffprobe command with a timeout of 5 seconds.

andrey-utkin commented 6 months ago

One more thing. Shouldn't be a deal breaker, but. By default ffmpeg's RTSP demuxer tries to use UDP. We could match what we do in bc-server: https://github.com/bluecherrydvr/bluecherry-apps/blob/master/lib/lavf_device.cpp#L90