ossrs / srs-gb28181

GB28181 server based on SRS
https://ossrs.net
MIT License
83 stars 41 forks source link

GB28181: srs部署再云端的,海康摄像头GB28181配置完成后,显示在线,但是查询所有会话,devices是空的。 #2417 #30

Open winlinvip opened 2 years ago

winlinvip commented 2 years ago

我用的配置文件是拷贝老版本格式的,后来更新上了,这个参数我也测试了,无论是真假 都不影响测试结果,

Originally posted by @platoxie in https://github.com/ossrs/srs/issues/2198#issuecomment-799184554

{ "code": 0, "data": { "sessions": [ { "id": "34020000001320000001", "device_sumnum": 0, "devices": [] } ] } }

devices是空的 版本5.0.3 海康摄像头,配置完成显示状态在线

srs.log 如下


[2021-06-16 15:44:22.691][Trace][18872][72e13im7] XCORE-SRS/5.0.3(Leo) [2021-06-16 15:44:22.691][Trace][18872][72e13im7] config parse complete [2021-06-16 15:44:22.691][Trace][18872][72e13im7] you can check log by: tail -f ./objs/srs.log (@see https://github.com/ossrs/srs/wiki/v1_CN_SrsLog) [2021-06-16 15:44:22.691][Trace][18872][72e13im7] please check SRS by: ./etc/init.d/srs status [root@VM-0-9-centos srs_r]# tail -f objs/srs.log [2021-06-16 15:44:22.699][Trace][18874][72e13im7] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3 [2021-06-16 15:44:22.699][Trace][18874][72e13im7] http: api mount /console to ./objs/nginx/html/console [2021-06-16 15:44:22.699][Trace][18874][72e13im7] rtc listen at udp://0.0.0.0:8000, fd=14 [2021-06-16 15:44:22.699][Trace][18874][45rza696] Hybrid cpu=0.00%,9MB [2021-06-16 15:44:22.700][Trace][18874][41626mx4] GB28181: connection manager run, conns=0 [2021-06-16 15:44:22.700][Trace][18874][c2827f7t] TCP: connection manager run, conns=0 [2021-06-16 15:44:22.700][Trace][18874][mmv944n3] UDP #14 LISTEN at 0.0.0.0:8000, SO_SNDBUF(default=212992, expect=10485760, actual=425984, r0=0), SO_RCVBUF(default=212992, expect=10485760, actual=425984, r0=0) [2021-06-16 15:44:22.700][Trace][18874][ri4q2076] RTC: connection manager run, conns=0 [2021-06-16 15:44:25.380][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:27.690][Trace][18874][45rza696] Hybrid cpu=1.00%,10MB [2021-06-16 15:44:29.390][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:32.690][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB [2021-06-16 15:44:33.401][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:35.806][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:36.316][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:37.330][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:37.410][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:37.690][Trace][18874][45rza696] Hybrid cpu=1.00%,10MB, cid=1,1, timer=63,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-06-16 15:44:39.341][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:42.691][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,1, timer=63,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-06-16 15:44:43.351][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:47.362][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:47.691][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,1, timer=63,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-06-16 15:44:51.373][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:52.692][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,0, timer=62,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-06-16 15:44:55.384][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:44:57.693][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,0, timer=62,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-06-16 15:44:59.394][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:02.694][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,0, timer=62,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-06-16 15:45:03.405][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered

[2021-06-16 15:45:05.809][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:06.321][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:07.331][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:07.414][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:07.694][Trace][18874][45rza696] Hybrid cpu=1.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:45:09.341][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:12.695][Trace][18874][45rza696] Hybrid cpu=1.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:45:13.352][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:17.362][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:17.696][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:45:21.372][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:22.697][Trace][18874][45rza696] Hybrid cpu=1.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:45:25.387][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:27.697][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:45:29.399][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:32.698][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:45:33.409][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:35.815][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:36.326][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:37.336][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:37.419][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:37.698][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:45:39.347][Trace][18874][72e13im7] gb28181: 34020000001320000001 client not registered [2021-06-16 15:45:40.817][Trace][18874][72e13im7] gb28181: request client id=34020000001320000001 peer(117.13.220.26, 5060) [2021-06-16 15:45:40.817][Trace][18874][72e13im7] gb28181: request method=REGISTER, uri=sip:34020000002000000001@3402000000, version=SIP/2.0 expires=3600 [2021-06-16 15:45:40.831][Trace][18874][72e13im7] gb28181: request client id=34020000001320000001 peer(117.13.220.26, 5060) [2021-06-16 15:45:40.831][Trace][18874][72e13im7] gb28181: request method=REGISTER, uri=sip:34020000002000000001@3402000000, version=SIP/2.0 expires=3600 [2021-06-16 15:45:40.845][Trace][18874][72e13im7] gb28181: request client id=34020000001320000001 peer(117.13.220.26, 5060) [2021-06-16 15:45:40.845][Trace][18874][72e13im7] gb28181: request method=REGISTER, uri=sip:34020000002000000001@3402000000, version=SIP/2.0 expires=3600 [2021-06-16 15:45:42.698][Trace][18874][45rza696] Hybrid cpu=1.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:45:43.819][Trace][18874][72z42b2v] gb28181: sip session=34020000001320000001 peer(117.13.220.26, 5060) status(RegisterOk,AliveOk) duration(2,0) [2021-06-16 15:45:47.699][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,1, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:45:52.700][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,1, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:45:57.700][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,1, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:46:02.701][Trace][18874][45rza696] Hybrid cpu=1.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:46:07.702][Trace][18874][45rza696] Hybrid cpu=1.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-06-16 15:46:12.703][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-06-16 15:46:17.704][Trace][18874][45rza696] Hybrid cpu=1.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-06-16 15:46:22.704][Trace][18874][45rza696] Hybrid cpu=0.00%,10MB, cid=1,0, timer=63,0,0, clock=0,49,0,0,0,0,0,0,0


通过查看GB28181国标文档,正常流程:摄像头通过国标调取的话。摄像头向请求方发注册,注册成功后,请求方向摄像头获取资源,获取成功后,通过国标ID向摄像头发INVITE。 为何SrsGb28181SipSession::do_cycle()中注册成功,需要先判断_device_list进行遍历? 而且这次测试发现注册成功后,通过srs_trace发现_device_list是空的