dart-sip-ua icon indicating copy to clipboard operation
dart-sip-ua copied to clipboard

[bug] hold() doesn't work in versions higher than 0.3.5 (on web)

Open IvoB1987 opened this issue 2 years ago • 2 comments

I don't know if I maybe use it wrong but hold() doesn't seem to work in recent versions (on web). The last version for which it works flawlessly is 0.3.5 of sip_ua.

I identified that the introduction of this line caused it:

_iceGatheringState = RTCIceGatheringState.RTCIceGatheringStateNew;

in the _createLocalDescription in rtc_session.dart at line 1642

Including the most recent package (0.5.1) in my project and just removing that line again seems to fix it for me. But I'm not confident in understanding the inner workings of the package to know if it has any unwanted side effects. The problem seems to arise when _iceGatheringState was in fact already completed at the moment _createLocalDescription is called. It will result inonIceCandidate or onIceGatheringState to be never be called again, which in return results in await _createLocalDescription to never finish in _sendReinvite, which is called by hold().

There's some other code in _createLocalDescription that seems strange to me as well. In the ready() block it says _iceGatheringState = RTCIceGatheringState.RTCIceGatheringStateComplete; which seems totally redundant because the ready block is only called after the _iceGatheringState is set to Complete already.

Maybe someone can shed some light on this? Or maybe am I missing something?

IvoB1987 avatar Mar 11 '22 07:03 IvoB1987

I am also experiencing this issue with hold, it seemed to start in 0.5.0 for me though. Prior to that, it seemed to be working fine (iOS/Android)

Edit: Removing that line does fix hold for me as well, but I'm unsure of the repercussions of it, i am also not familiar enough with the codebase. @cloudwebrtc would you be able to take a look at it please when you have some time?

Ant-Pinto avatar Mar 14 '22 18:03 Ant-Pinto

@Ant-Pinto I am getting this issue from v0.3.8 and above for iOS and Android. Are you sure that it's working for these versions?

ashutosh-pant avatar Apr 28 '22 08:04 ashutosh-pant

Fixed with b5da45936b0e2fa2fc9b862e0c9fcfe0974c7780

IvoB1987 avatar Nov 09 '22 09:11 IvoB1987