Help Needed: iOS Softphone Not Ringing with Asterisk When App Backgrounded/Locked (CallKit/PushKit Solutions?)

Hello Asterisk Community,

I’m hoping you can help me with a persistent issue I’m facing with my Asterisk setup and iOS softphones. I’d be very grateful for any insights or solutions you might have.

  • I have successfully installed Asterisk on a Linux machine running Debian Bookworm.

  • I’ve configured it, and it functions as a VoIP server.

The Problem:
The issue specifically relates to receiving incoming calls on my iPhone (iOS) using VoIP softphone apps (like Zoiper or similar alternatives).

  • When the softphone app is open and in the foreground:* Incoming calls work perfectly. My iPhone rings, and I can answer the call.

  • When the softphone app is in the background, completely closed, or my iPhone’s screen is locked: I do not receive any notification for incoming calls. The phone does not ring, and I only discover missed calls if I happen to open the app later.

What I’m Looking For:
I understand this is likely due to iOS backgrounding restrictions and the need for push notifications to “wake up” the app for incoming calls. I’m trying to figure out the best way to resolve this.

  1. General Solutions: What is the recommended approach to ensure iOS softphones reliably receive incoming call notifications from Asterisk when the app is not active or the screen is locked?

  2. CallKit/PushKit Integration:

  • I believe integrating with Apple’s CallKit and/or PushKit is necessary. Could someone provide guidance, best practices, or point me to resources (tutorials, examples, relevant Asterisk modules/configurations) on how to implement this with an Asterisk server?

  • Are there specific configurations or source code examples available that demonstrate how Asterisk can send the necessary push notifications to iOS clients?

  1. Cost Implications:
  • Does implementing a reliable push notification solution (like CallKit/PushKit) for Asterisk-to-iOS calls involve any unavoidable costs? For example, are there server-side costs, or costs associated with the softphone app development/licensing that I should be aware of? Can this be achieved without incurring additional expenses?

I’m eager to get this working reliably and would appreciate any assistance or direction you can offer.

Thank you in advance for your time and expertise!

Best regards,

This topic comes up from time to time and your question is all completely relevant.

The parts that ChatGPT has left out, and the reason nobody else has answered so far, is that in order to send a push notification for ios you need…

To have an Apple Developer account, and the same for Google/Android. This alone puts this topic way outside of scope.

Then, depending on the users platform, you need to “keep” their device token, in some sort of database, with a key value pair, that says Alice is on xxx mobile device is using xxx device token. Tricky in itself, but there exists no standard on how to handle this. Let alone the API for handling the request from the device. Either way, it’s even further outside the realm of Asterisk.

But let’s say you and ChatGPT get that right, now you need to get Asterisk to do something it really doesn’t like… that is; take a call in… and wait… wait for what? It must wait for the “intended endpoint” to come online, in order to know the actual “contact”, in order to check the contact that does come online is the one that the device is mapped to.

Then there is also the underlining SIP messaging behind this… do you reply with 100 Trying? 180 Ringing? are you actually ringing? Who knows?

And while Asterisk can do many things, it doesn’t have a “Wait-Until-Alice-Comes-Online” Function in the dailplan. I’m not saying you cannot get this right - i’s probably possible, and there may be guys that have built some AGI/FastAGI that can do this, but you are in for quite a challenge. I tried this a number of years ago, and got a reasonable level of reliability, but there are many, many parameters.

Our approach when building the Softphone at Siperb was to handle the call via a proxy, that can do all the above, and leave Asterisk PBX as-is. We allow you to register always via our platform, and when calls come in, we proxy in the INVITE to you after waking your phone, and sending to call down to you over a secondary registration.

It’s similar with Growndwire, they provide a solution that works slightly differently - they “take over” the registration as the phone goes into the background, so it will keep your registration open on their server when your app is in the background. Then, when a call comes in they send you the call after waking the app up. We found that this handover and back again of the registration can introduce unexpected paths and servers, making it less predictable.

I believe that is what Sangoma do, as well.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.