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
588 stars 355 forks source link

Linphone for IOS not receiving calls after 5 minutes not using it #904

Closed asder78 closed 2 weeks ago

asder78 commented 11 months ago

I have two linphone acounts

If iphone screen is on, i can call from Windows client to IOS client correctly, it works great

But, if i don't use iphone at all for (aprox) five minutes, if i call from Windows Client to IOS client the call is not presented on the iphone

May be it is a bug, or may be i have to adjust some settings?

Thanks in advance

Viish commented 11 months ago

Hi Alfredo,

iOS apps can't live while in background. The only way for an app to be waken up is to receive a push notification from an Apple push server. If you are using our own linphone-iphone app from the App Store you should receive this push. If you don't, please upload debug logs from the app so we can check what happens.

Cheers,

asder78 commented 11 months ago

Attached you can find a log file linphone_log.gz

I made a call from Linphone_Win (alfredo_002@sip.linphone.org) to Linphone_IOS (alfredo_003@sip.linphone.org) at 12:26

Linphone_Win ended the call 50 seconds later (aprox); nothing happened at Linphone_IOS

Linphone_IOS waked up at 12:28 with an empty call

There are no logs at 12:26

Logs in that interval are:

_2023-12-21 12:18:34:110 [linphone/mediastreamer] MESSAGE [IOS Audio Route Change] Audio unit not initialized, ignore route change 2023-12-21 12:28:48:460 [linphone/liblinphone] MESSAGE [PushKit] Notification [0x281b16d80] received with payload : { aps = { "call-id" = STh9d40Q7D; "loc-args" = ( "Alfredo_Win" ); "loc-key" = "IC_MSG"; "send-time" = "2023-12-21 11:26:36"; sound = ""; uuid = ""; }; customPayload = { }; "display-name" = "Alfredo_Win"; "from-uri" = "sip:alfredo_002@sip.linphone.org"; "pnttl" = 50; } 2023-12-21 12:28:48:460 [linphone/liblinphone] WARNING Core was Off, before starting it again we need to init it 2023-12-21 12:28:48:460 [linphone/liblinphone] MESSAGE Initializing LinphoneCore 5.2.106 2023-12-21 12:28:48:460 [linphone/liblinphone] MESSAGE Sal nat helper [enabled] 2023-12-21 12:28:48:460 [linphone/liblinphone] MESSAGE [SHARED] setup IosSharedCoreHelpers 2023-12-21 12:28:48:460 [linphone/liblinphone] MESSAGE [SHARED] launch timer 2023-12-21 12:28:48:460 [linphone/liblinphone] MESSAGE [SHARED] unlockSharedCoreIfNeeded : no update during last 30 sec

Arguillq commented 11 months ago

Hi,

the 5.2.0 version of linphone-iphone is arriving on the stores in the coming days, please give it another try with the new version when available. If it still do not work, we will investigate deeper into this issue

asder78 commented 11 months ago

I've updated to version 5.2, now available at App Store

I'm, afraid it is still failing

I attach log file, i made a call at 12:08, not ringing until 12:10:50 aprox linphone_log.txt

It is notorious that there are no messages in log from 12:00:24:060 until 12:10:51:098 (remember a call was made at 12:08)

2023-12-22 12:00:24:060 [linphone/liblinphone] MESSAGE Sal already null 2023-12-22 12:10:51:098 [linphone/liblinphone] MESSAGE [PushKit] Notification [0x280b5d180] received with payload : {

jimvanm commented 7 months ago

I would like to add to this that we have the same problem with the Linphone (iPhone) downloaded from the App Store. We just ran three tests (with logging turned on and sending the logs right after the call). Three scenarios (and results):

  1. Linphone not running in foreground: call does not ring device
  2. Linphone in foreground (has not been used yet this day): call does not ring device
  3. Linphone used to make call, and then right after we send a call to it: call rings as expected We're happy to help troubleshoot this in any way that is helpful to you.
digitalwaterfall24 commented 5 months ago

Hello! My team is also having this problem. I am on (an admittedly quite old) iPhone 6s using iOS 15.8.1. Linphone disconnects whenever it is running in the background. I have Background App Refresh enabled, Battery Saver disabled, and push notifications are enabled.

Worth noting that even when I have linphone open and am properly connected, i can't receive calls; anyone who calls just gets a "call declined" message immediately.

Here are the debug logs:

`==> core-fastagi_out.log <==
2024-06-12 09:36 -07:00: [59588] Asterisk connection opened
2024-06-12 09:36 -07:00: [59588] Launching ./missedcallnotify.php with args: s,,s,0,,PJSIP/99-0000001f,INVALIDARGS,,,
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_network: yes
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_network_script: missedcallnotify.php
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_request: agi
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_channel: PJSIP/99-0000001f
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_language: en
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_type: PJSIP
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_uniqueid: 1718210206.31
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_version: 16.30.1
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_callerid: 99
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_calleridname: userguy
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_callingpres: 0
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_callingani2: 0
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_callington: 0
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_callingtns: 0
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_dnid: 502
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_rdnis: unknown
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_context: app-missedcall-hangup
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_extension: s
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_priority: 7
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_enhanced: 0.0
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_accountcode:
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_threadid: 140301071017728
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_arg_1: s
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_arg_2:
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_arg_3: s
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_arg_4: 0
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_arg_5:
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_arg_6: PJSIP/99-0000001f
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_arg_7: INVALIDARGS
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_arg_8:
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_arg_9:
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_arg_10:
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_ASTAGIDIR: /var/lib/asterisk/agi-bin
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> agi_port: 59588
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>>
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE MCGROUP
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=0
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE CHANNEL(STATE)
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=1 (Ring)
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE MCEXTEN
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=1 (99)
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE MCNAME
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=1 (userguy)
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE MCNUM
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=1 (99)
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE MCVMSTATUS
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=1 ()
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE MCQUEUE
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=0
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE MCFMFM
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=0
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE CHANNEL(LINKEDID)
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=1 (1718210206.31)
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE CHANNEL(UNIQUEID)
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=1 (1718210206.31)
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< GET VARIABLE MCORGCHAN
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=1 (PJSIP/99-0000001f)
2024-06-12 09:36 -07:00: [59588][1718210206.31] <<< SET VARIABLE MASTER_CHANNEL(MC-966172cdf6e5960ae8b7ff8efc53a620) "1"
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>> 200 result=1
2024-06-12 09:36 -07:00: [59588] Script ended with code 0 and signal null
2024-06-12 09:36 -07:00: [59588][1718210206.31] >>TRIED TO SEND TO DEAD AGI>> HANGUP
2024-06-12 09:36 -07:00: [59588] Asterisk connection closed

==> full <==
[2024-06-12 09:36:46] WARNING[96725][C-00000013] app_dial.c: Dial argument takes format (technology/resource)
[2024-06-12 09:36:46] ERROR[776] cdr.c: Unable to find CDR for channel PJSIP/99-0000001f
[2024-06-12 09:36:46] ERROR[776] cdr.c: Unable to find CDR for channel PJSIP/99-0000001f

`