BelledonneCommunications / linphone-iphone

Linphone is a free VoIP and video softphone based on the SIP protocol. Mirror of linphone-iphone (git://git.linphone.org/linphone-iphone.git)
http://linphone.org
GNU General Public License v3.0
583 stars 346 forks source link

Call terminate on Push received #944

Open mircoiplabs opened 3 months ago

mircoiplabs commented 3 months ago

Hello!

I've a strange bug, I updated my Linphone-based iOS application from the release 4.x to the last 5.2 release, with SDK 5.3.57.

When I receive a push notification, my app woke up for few seconds, than the CallKit disappear and the call seems lost.

From logs, I found:

2024-07-18 12:18:04:113 [linphone/liblinphone] MESSAGE CallSession [0x301a286a8] moving from state LinphoneCallIdle to LinphoneCallPushIncomingReceived 2024-07-18 12:18:04:113 [linphone/ios] MESSAGE CallKit: incoming call displaying and callId 206 2024-07-18 12:18:04:113 [linphone/ios] MESSAGE CallKit: call state update, it is: PushIncomingReceived 2024-07-18 12:18:04:114 [linphone/ios] MESSAGE CallKit: report new incoming call with call-id: [206] and UUID: [uuid-number...] 2024-07-18 12:18:04:118 [linphone/ios] MESSAGE [Calls] Call state changed: <Call-ID: 206 pointer:0x000000030302c700 is conference:false > : PushIncomingReceived 2024-07-18 12:18:04:118 [linphone/ios] MESSAGE [Calls] Current call is <Call-ID: 206 pointer:0x000000030302c700 is conference:false > 2024-07-18 12:18:04:118 [linphone/ios] WARNING [Calls] Call not found in calls data list, shouldn't happen! currentCallData is <Call-ID: 206 pointer:0x000000030302c700 is conference:false > 2024-07-18 12:18:04:119 [linphone/liblinphone] ERROR Unable to set window ID because video control interface cannot be found 2024-07-18 12:18:04:119 [linphone/ios] MESSAGE ( PhoneMainView.m:732 ) Change current view to linphoneapp.SingleCallView 2024-07-18 12:18:04:120 [linphone/liblinphone] ERROR Unable to set window ID because video control interface cannot be found 2024-07-18 12:18:04:120 [linphone/ios] MESSAGE ( PhoneMainView.m:732 ) Change current view to linphoneapp.SingleCallView 2024-07-18 12:18:04:126 [linphone/liblinphone] ERROR Unable to set window ID because video control interface cannot be found 2024-07-18 12:18:04:126 [linphone/ios] MESSAGE [Call Controls] Call state changed: <Call-ID: 206 pointer:0x000000030302c700 is conference:false > : PushIncomingReceived 2024-07-18 12:18:04:127 [linphone/ios] MESSAGE [Audio Route Helper] Playback audio currently in use is [n/a] with type (Unknown 2024-07-18 12:18:04:127 [linphone/liblinphone] MESSAGE Linphone core [0x114824400] notified [call_state_changed] 2024-07-18 12:18:04:127 [linphone/liblinphone] ERROR [pushkit] terminating call prematuraly because a call with call-id [206] was found in the past. 2024-07-18 12:18:04:127 [linphone/liblinphone] ERROR [pushkit] the past call with same call-id was: Incoming call with call-id: 206 at Thu Jul 18 10:08:33 2024 From: Address("CallKit Error" sip:anonymous@anonymous.invalid) To: Address("Anonymous" sip:anonymous@anonymous.invalid) Status: unknown Duration: 0 mn 0 sec

2024-07-18 12:18:04:127 [linphone/liblinphone] MESSAGE Terminate CallSession [0x301a286a8] which is currently in state [LinphoneCallPushIncomingReceived] 2024-07-18 12:18:04:127 [linphone/liblinphone] MESSAGE [pushkit] Terminate CallSession [0x301a286a8] 2024-07-18 12:18:04:127 [linphone/liblinphone] MESSAGE [ToneManager] notifyToneIndication reason Call declined

I've no idea why it says that: "terminating call prematuraly because a call with call-id [206] was found in the past.", what does it means? I don't face this issue with previous version...

Thank you!

mircoiplabs commented 3 months ago

Sorry I found the problem.

The call-id we send in our push-notification is static, but in this new SDK there is ( I guess ) the control that the call-id must be unique (even if a call is terminated in the past). In previous version there wasn't this check.

I send the call-id randomically in our push and now it works!

mircoiplabs commented 3 months ago

Solved

HPR10 commented 2 months ago

Hi, I saw your response about the issue with the static call-id and the requirement for it to be unique in the new SDK. Could you please clarify exactly where you made the modifications? Did you change this in the SDK itself or in the Linphone iOS application code?

Thank you!

mircoiplabs commented 6 days ago

Hi, I saw your response about the issue with the static call-id and the requirement for it to be unique in the new SDK. Could you please clarify exactly where you made the modifications? Did you change this in the SDK itself or in the Linphone iOS application code?

Thank you!

Sorry for the delay!

I changed the system I use to send the push notification, I changed the payload to generate a random token for each call!

mircoiplabs commented 6 days ago

Sorry, there is a way to "intercept" and/or manipulate the call-id in the push payload to avoid this check? Or a way to bypass this check

Thank you so much!