ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
24.74k stars 5.28k forks source link

GB28181: Fix when camera restart, can not connect to SRS. #3944 #3947

Open yushimeng opened 5 months ago

yushimeng commented 5 months ago

Destroy session when SIP connection is disconnected

daveyang05 commented 4 months ago

Hello @yushimeng, could you please inform us by which version the logic modifications will be completed, and on which branch these changes will be made? We would like to conduct subsequent tests to verify if everything is functioning as expected.

TRANS_BY_GPT4

duiniuluantanqin commented 4 months ago

Please fix the error in the utest-regression-blackbox-test first, thank you.

TRANS_BY_GPT4

duiniuluantanqin commented 4 months ago

I tested with a Uniview camera, and after restarting, it was unable to connect to the SRS. However, prior to the changes, it was capable of reconnecting.

TRANS_BY_GPT4

winlinvip commented 4 months ago

Previously, there was a process in place for handling reconnection logic, but it seems that something might have been overlooked. Therefore, it is recommended to first thoroughly analyze the issue before making any modifications.

Additionally, we must add test cases to verify it. We have supported GB emulation in utest-regression-blackbox-test, so we can use it to simulate SIP disconnections and cover such exceptional scenarios. This approach will prevent the introduction of new issues during the modification process.

Since the GB camera is a hardware device, using actual hardware for verification after every modification is highly inefficient and can lead to very poor quality. Therefore, test cases also need to be improved: whenever code is modified, additional test cases must be added to verify and ensure test coverage, confirming that the changes made to the code are reasonable.

Although this approach may be more challenging, it is very worthwhile. I hope for your understanding.

TRANS_BY_GPT4

yushimeng commented 4 months ago

I very much agree with your approach. My previous idea was that session resources should be deleted after the connection is disconnected, but I overlooked the fact that SrsLazyObjectWrapper serves to isolate resources for sessions, SIP, and media. We should first identify the problem, and then supplement the test cases. @daveyang05, could you provide the log files and configuration files, please?

TRANS_BY_GPT4