flutter-webrtc / callkeep

iOS CallKit and Android ConnectionService for Flutter
MIT License
137 stars 150 forks source link

iOS crashes when doing reportNewIncomingCallWithUUID (parameter 'UUID' cannot be nil) #164

Open sashker opened 1 year ago

sashker commented 1 year ago

Hello.


When I receive an incoming call, my app crashed with the next output:

flutter: [2023-03-19 08:59:13.280] Level.debug sip_ua_helper.dart:182 ::: newRTCSession => Instance of 'EventNewRTCSession'
flutter: SoftPhoneService 956263204 -> Call state changed: CallStateEnum.CALL_INITIATION
[CallKeep][reportNewIncomingCall] uuidString = bec5c7b0-5ed9-46b6-b67a-4940470e07af96Nrt1yFS85Bg
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CXProvider reportNewIncomingCallWithUUID:update:completion:]: parameter 'UUID' cannot be nil'
*** First throw call stack:
(0x180c13c80 0x198438ee4 0x180c66e84 0x1aab987a8 0x100a58bb8 0x100a56c34 0x100a55178 0x100a5b45c 0x105ac6258 0x10557558c 0x1808d3094 0x1808d4094 0x180880d44 0x180880994 0x180bcf034 0x180b8c538 0x180b9f194 0x1a16d2988 0x1833a1a88 0x18313afc8 0x1004d0074 0x100af44d0)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT

I'm pretty sure that UUID is passed to _callKeep.displayIncomingCall(uuid, callerId,localizedCallerName: callerId, hasVideo: false); but nonetheless, the crash occurs somewhere deeper.

The Android version works well and shows/maintains an incoming call.

sashker commented 1 year ago

In iOS 16.3.1 the same behaviour

sashker commented 1 year ago

The culprit is an incorrect UUID coming from the sip-ua. I don't know where it is coming from but when it isn't a real UUID - iOS code is not able to parse it and send further away. I'd implement an additional check up if uuid != nil because it looks very likely to pass some incorrect uuid.