|
@@ -158,7 +158,7 @@ class oa2TokenView(TemplateView):
|
|
|
print(res_json)
|
|
|
return JsonResponse(res_json)
|
|
|
else:
|
|
|
- return JsonResponse({'msg':'error'})
|
|
|
+ return JsonResponse({'msg': 'error'})
|
|
|
else:
|
|
|
res_json = {'msg': 'code not exists'}
|
|
|
print(res_json)
|
|
@@ -181,14 +181,22 @@ class oa2RtspStartView(TemplateView):
|
|
|
'''
|
|
|
VVDHCVBYDKFMJRWA111A
|
|
|
'''
|
|
|
- UID = request_dict.get("UID", '')
|
|
|
- PWD = request_dict.get("PWD", '')
|
|
|
- MSG = request_dict.get("MSG", '')
|
|
|
- # po = Pool(10)
|
|
|
- # po.apply_async(self.runSendRtspMsg, (UID, PWD, MSG))
|
|
|
- self.runSendRtspMsg(UID, PWD, MSG)
|
|
|
- response = ResObject()
|
|
|
- return response.json(0, {'res': 'yes'})
|
|
|
+ access_token = request_dict.get("access_token", '')
|
|
|
+ id = request_dict.get("id", '')
|
|
|
+
|
|
|
+ user_qs = UserModel.objects.filter(access_token=access_token)
|
|
|
+ if user_qs.exists():
|
|
|
+ userID = user_qs[0].userID
|
|
|
+ ur_qs = UidRtspModel.objects.filter(user_id=userID, id=id).values('uid', 'nick', 'rtsp_url', 'password')
|
|
|
+ UID = ur_qs[0]['uid']
|
|
|
+ PWD = ur_qs[0]['password']
|
|
|
+ MSG = ur_qs[0]['rtsp_url']
|
|
|
+ # po = Pool(10)
|
|
|
+ # po.apply_async(self.runSendRtspMsg, (UID, PWD, MSG))
|
|
|
+ self.runSendRtspMsg(UID, PWD, MSG)
|
|
|
+ return JsonResponse({'msg': 'ok'})
|
|
|
+ else:
|
|
|
+ return JsonResponse({'msg': 'wrong'})
|
|
|
|
|
|
def runSendRtspMsg(self, UID, PWD, MSG):
|
|
|
command = "./test {UID} {PWD} {MSG}".format(UID=UID, PWD=PWD, MSG=MSG)
|
|
@@ -237,10 +245,14 @@ class oa2DiscoveryDevice(TemplateView):
|
|
|
'uri': 'rtsp://www.zositech.org:443/{stream_name}'.format(stream_name=ur['rtsp_url'])
|
|
|
}
|
|
|
res_json.append(ur_data)
|
|
|
- return JsonResponse(res_json,safe=False)
|
|
|
+ return JsonResponse(res_json, safe=False)
|
|
|
# return response.json(0, res_json)
|
|
|
else:
|
|
|
return response.json(0, 'data is none~')
|
|
|
else:
|
|
|
- return JsonResponse({'res':'11'})
|
|
|
- return response.json(0, 'error')
|
|
|
+ return JsonResponse({'res': '11'})
|
|
|
+
|
|
|
+
|
|
|
+'''
|
|
|
+[{"endpointId":1,"manufacturerName":"Axis","manufacturerId":"axis-ACCC8E5E7513","modelName":"P1425-LE","friendlyName":"Camera VVDHCV","description":"Camera VVDHCV","resolutions":[{"width":1280,"height":720}],"videoCodecs":["H264"],"audioCodecs":["ACC"],"protocols":["RTSP"],"authorizationTypes":["NONE"],"uri":"rtsp://www.zositech.org:443/WVZsWkVTRU5XUWxsRVMwWk5TbEpYUVRFeE1VRT1p"},{"endpointId":2,"manufacturerName":"Axis","manufacturerId":"axis-ACCC8E5E7513","modelName":"P1425-LE","friendlyName":"Camera 5N6ZW8","description":"Camera 5N6ZW8","resolutions":[{"width":1280,"height":720}],"videoCodecs":["H264"],"audioCodecs":["ACC"],"protocols":["RTSP"],"authorizationTypes":["NONE"],"uri":"rtsp://www.zositech.org:443/Rk5VNDJXbGM0TnpSSE5rRXpOMWMwTmpFeE1VRT1D"},{"endpointId":3,"manufacturerName":"Axis","manufacturerId":"axis-ACCC8E5E7513","modelName":"P1425-LE","friendlyName":"Camera T3SLCA","description":"Camera T3SLCA","resolutions":[{"width":1280,"height":720}],"videoCodecs":["H264"],"audioCodecs":["ACC"],"protocols":["RTSP"],"authorizationTypes":["NONE"],"uri":"rtsp://www.zositech.org:443/b1ZETlRURU5CU0VvNVVERktTRmxDTkRFeE1VRT1X"}]
|
|
|
+'''
|