srs icon indicating copy to clipboard operation
srs copied to clipboard

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

Open yushimeng opened this issue 1 year ago • 5 comments

Destroy session when SIP connection is disconnected

yushimeng avatar Feb 02 '24 11:02 yushimeng

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

daveyang05 avatar Feb 04 '24 00:02 daveyang05

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

TRANS_BY_GPT4

duiniuluantanqin avatar Feb 04 '24 05:02 duiniuluantanqin

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

duiniuluantanqin avatar Feb 04 '24 06:02 duiniuluantanqin

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

winlinvip avatar Feb 06 '24 02:02 winlinvip

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

yushimeng avatar Feb 06 '24 04:02 yushimeng