This enables closing peer connection from outside peer connection factory.
Also improve unit test coverage around refreshing peer connection.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Testing:
Setup CCP locally. Verified that using chrome://webrtc-internals that idle peer connection is spun up every minute and existing open one gets cleaned up.
Then invoked connect.core.softphoneManager.rtcPeerConnectionFactory.close() via browser console
and verified that instead of refreshing idle peer connection, open one is closed and then no idle peer connection is spun up next minute.
connect.core.softphoneManager.rtcPeerConnectionFactory.close()
connect-streams-min.js:1 [2024-06-11T21:24:16.710Z] [LOG] [2a3eb537-57d5-412e-895b-86eff33cc2bf]: close method invoked. Clear timer and close idle peer connection 1718139646463-j8beuivgtbg
Additional verification will be done via softphone manager where this will eventually be used. Those softphone manager changes are work in progress by another developer.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Testing: Setup CCP locally. Verified that using chrome://webrtc-internals that idle peer connection is spun up every minute and existing open one gets cleaned up.
Then invoked
connect.core.softphoneManager.rtcPeerConnectionFactory.close()
via browser console and verified that instead of refreshing idle peer connection, open one is closed and then no idle peer connection is spun up next minute.Regression testing notes are here: https://quip-amazon.com/pYToAkumdjgq/RtcJs-ACGR-Testing. I will be working to prioritize automated testing as well as unit test coverage improvements for this repo.
Additional verification will be done via softphone manager where this will eventually be used. Those softphone manager changes are work in progress by another developer.