use-go / onvif

full and enhanced onvif protocol stack in golang.
MIT License
400 stars 187 forks source link

GetProfile is not working in some cameras. #43

Closed kalmastenitin closed 2 months ago

kalmastenitin commented 10 months ago

IP Camera Company Named Syntel All other endpoints are working fine: but profile request is asking for authentication but dahua cameras are working fine.

Here is request :- `<?xml version="1.0" encoding="UTF-8"?>

admin tmD70TuteOMdpVIqXhSzkx1/w+M= n1115yhlqt6di7bme8ea54xq6mqun47h 2023-11-24T07:54:33.429776418Z

</soap-env:Header>

All ` Response Provided By the camera :- ` SOAP-ENV:Senderter:NotAuthorizedSender not AuthorizedThe action requested requires authorization and the sender is not authorized.` I'am trying to fetch snapshot url here. so i need to fetch all profiles. Same Request Gives Success with Dahua Camera:- `Profile000VideoSource0002VideoSource000VideoEncoder0001H265192010804.0000001115362MainIPv4224.1.2.44000064falsePT60SAnalytics0002PTZ0002PTZ000http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpacehttp://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpacePT10SMetadata0001falsefalsetns1:Media/ConfigurationChangedtrueIPv4224.1.2.44000064falsePT60SProfile001VideoSource0002VideoSource000VideoEncoder0011H2647045764.000000112562MainIPv4224.1.2.44001664falsePT60SAnalytics0002PTZ0002PTZ000http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpacehttp://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpacePT10SMetadata0011falsefalsetns1:Media/ConfigurationChangedtrueIPv4224.1.2.44001664falsePT60S` Please Help Me out Here.
kalmastenitin commented 10 months ago

@kikimor @GreenLightning Camera is working with windows onvif client

cedricve commented 9 months ago

Yes looks like not stable enough as ONVIF version might be different, and the authentication mechanism might fail. No clue so far..

cedricve commented 9 months ago

@kalmastenitin what is the ONVIF version on both cameras. I do have 2 Hikvisions one with ONVIF 17 (working) and another one ONVIF 19 (not working). My guess is that the authentication being used, changed a bit over the version, making it not able to authenticate.

https://github.com/use-go/onvif/blob/master/Device.go#L282-L284

aiwatcher commented 2 months ago

@kalmastenitin what is the ONVIF version on both cameras. I do have 2 Hikvisions one with ONVIF 17 (working) and another one ONVIF 19 (not working). My guess is that the authentication being used, changed a bit over the version, making it not able to authenticate.

https://github.com/use-go/onvif/blob/master/Device.go#L282-L284

@cedricve have you fixed the issue about ONVIF 19 ?

kalmastenitin commented 2 months ago

@aiwatcher some of the cameras are having only digest authentication/basic auth and some of them isn't support onvif at all. so I fixed that by adding digest authentication as default.

aiwatcher commented 2 months ago

@kalmastenitin great,would you plz share your example fixed code here ? thx

kalmastenitin commented 2 months ago

use this library instead it was forked of this before it was working

aiwatcher commented 2 months ago

@kalmastenitin so appreciate