diff --git a/machinery/docs/docs.go b/machinery/docs/docs.go index e1d6ff1..422b332 100644 --- a/machinery/docs/docs.go +++ b/machinery/docs/docs.go @@ -279,6 +279,40 @@ const docTemplate = `{ } } }, + "/api/camera/onvif/verify": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Will verify the ONVIF connectivity.", + "tags": [ + "onvif" + ], + "summary": "Will verify the ONVIF connectivity.", + "operationId": "verify-onvif", + "parameters": [ + { + "description": "OnvifCredentials", + "name": "config", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.OnvifCredentials" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.APIResponse" + } + } + } + } + }, "/api/camera/onvif/zoom": { "post": { "description": "Zooming in or out the camera.", @@ -590,40 +624,6 @@ const docTemplate = `{ } } }, - "/api/onvif/verify": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "Will verify the ONVIF connectivity.", - "tags": [ - "onvif" - ], - "summary": "Will verify the ONVIF connectivity.", - "operationId": "verify-onvif", - "parameters": [ - { - "description": "OnvifCredentials", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.OnvifCredentials" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.APIResponse" - } - } - } - } - }, "/api/persistence/verify": { "post": { "security": [ diff --git a/machinery/docs/swagger.json b/machinery/docs/swagger.json index a4e7d7f..deec611 100644 --- a/machinery/docs/swagger.json +++ b/machinery/docs/swagger.json @@ -271,6 +271,40 @@ } } }, + "/api/camera/onvif/verify": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Will verify the ONVIF connectivity.", + "tags": [ + "onvif" + ], + "summary": "Will verify the ONVIF connectivity.", + "operationId": "verify-onvif", + "parameters": [ + { + "description": "OnvifCredentials", + "name": "config", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.OnvifCredentials" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.APIResponse" + } + } + } + } + }, "/api/camera/onvif/zoom": { "post": { "description": "Zooming in or out the camera.", @@ -582,40 +616,6 @@ } } }, - "/api/onvif/verify": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "Will verify the ONVIF connectivity.", - "tags": [ - "onvif" - ], - "summary": "Will verify the ONVIF connectivity.", - "operationId": "verify-onvif", - "parameters": [ - { - "description": "OnvifCredentials", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.OnvifCredentials" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.APIResponse" - } - } - } - } - }, "/api/persistence/verify": { "post": { "security": [ diff --git a/machinery/docs/swagger.yaml b/machinery/docs/swagger.yaml index 6b5fa6b..11f1c43 100644 --- a/machinery/docs/swagger.yaml +++ b/machinery/docs/swagger.yaml @@ -494,6 +494,27 @@ paths: summary: Will return the ONVIF presets for the specific camera. tags: - onvif + /api/camera/onvif/verify: + post: + description: Will verify the ONVIF connectivity. + operationId: verify-onvif + parameters: + - description: OnvifCredentials + in: body + name: config + required: true + schema: + $ref: '#/definitions/models.OnvifCredentials' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.APIResponse' + security: + - Bearer: [] + summary: Will verify the ONVIF connectivity. + tags: + - onvif /api/camera/onvif/zoom: post: description: Zooming in or out the camera. @@ -700,27 +721,6 @@ paths: summary: Get Authorization token. tags: - authentication - /api/onvif/verify: - post: - description: Will verify the ONVIF connectivity. - operationId: verify-onvif - parameters: - - description: OnvifCredentials - in: body - name: config - required: true - schema: - $ref: '#/definitions/models.OnvifCredentials' - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.APIResponse' - security: - - Bearer: [] - summary: Will verify the ONVIF connectivity. - tags: - - onvif /api/persistence/verify: post: description: Will verify the persistence. diff --git a/machinery/src/capture/Gortsplib.go b/machinery/src/capture/Gortsplib.go index d9db09f..55a1cfa 100644 --- a/machinery/src/capture/Gortsplib.go +++ b/machinery/src/capture/Gortsplib.go @@ -360,7 +360,7 @@ func (g *Golibrtsp) Start(ctx context.Context, queue *packets.Queue, configurati // decode timestamp pts, ok := g.Client.PacketPTS(g.AudioG711Media, rtppkt) if !ok { - log.Log.Warning("capture.golibrtsp.Start(): " + "unable to get PTS") + log.Log.Debug("capture.golibrtsp.Start(): " + "unable to get PTS") return } @@ -443,7 +443,7 @@ func (g *Golibrtsp) Start(ctx context.Context, queue *packets.Queue, configurati // decode timestamp pts, ok := g.Client.PacketPTS(g.VideoH264Media, rtppkt) if !ok { - log.Log.Warning("capture.golibrtsp.Start(): " + "unable to get PTS") + log.Log.Debug("capture.golibrtsp.Start(): " + "unable to get PTS") return } @@ -554,7 +554,7 @@ func (g *Golibrtsp) Start(ctx context.Context, queue *packets.Queue, configurati // decode timestamp pts, ok := g.Client.PacketPTS(g.VideoH265Media, rtppkt) if !ok { - log.Log.Warning("capture.golibrtsp.Start(): " + "unable to get PTS") + log.Log.Debug("capture.golibrtsp.Start(): " + "unable to get PTS") return } diff --git a/machinery/src/onvif/main.go b/machinery/src/onvif/main.go index 7797bbd..2e0951e 100644 --- a/machinery/src/onvif/main.go +++ b/machinery/src/onvif/main.go @@ -898,7 +898,7 @@ func GetPTZFunctionsFromDevice(configurations ptz.GetConfigurationsResponse) ([] } // VerifyOnvifConnection godoc -// @Router /api/onvif/verify [post] +// @Router /api/camera/onvif/verify [post] // @ID verify-onvif // @Security Bearer // @securityDefinitions.apikey Bearer diff --git a/machinery/src/routers/http/routes.go b/machinery/src/routers/http/routes.go index 176cdd8..e3cd587 100644 --- a/machinery/src/routers/http/routes.go +++ b/machinery/src/routers/http/routes.go @@ -54,11 +54,6 @@ func AddRoutes(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware, configDirect components.UpdateConfig(c, configDirectory, configuration, communication) }) - // Will verify the current onvif settings. - api.POST("/onvif/verify", func(c *gin.Context) { - onvif.VerifyOnvifConnection(c) - }) - // Will verify the current hub settings. api.POST("/hub/verify", func(c *gin.Context) { cloud.VerifyHub(c) @@ -94,7 +89,8 @@ func AddRoutes(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware, configDirect }) // Onvif specific methods. Doesn't require any authorization. - + // Will verify the current onvif settings. + api.POST("/camera/onvif/verify", onvif.VerifyOnvifConnection) api.POST("/camera/onvif/login", LoginToOnvif) api.POST("/camera/onvif/capabilities", GetOnvifCapabilities) api.POST("/camera/onvif/presets", GetOnvifPresets)