About Delay issues with iPhone VoIP applications

We are encountering the following issue with our VoIP application for iPhone, published on the App Store, and would appreciate your guidance on possible countermeasures.

The VoIP application (callee side) utilizes a Wi-Fi network. The sequence leading to the issue is as follows:

  1. VoIP App (callee): Launches
  2. iPhone (callee): Locks (e.g., by short-pressing the power button)
  3. VoIP App (callee): Transitions to a suspended state
  4. VoIP App (caller): Initiates a VoIP call
  5. VoIP App (callee): Receives a local push notification
  6. VoIP App (callee): Answers the incoming call
  7. VoIP App (callee): Executes performAnswerCallAction()

After this, the VoIP App (callee) uses "NSTimer scheduledTimerWithTimeInterval" to manage internal processing timing. However, the processing sometimes takes longer than the specified waiting time. Specifically, delays of several seconds can occur.

We understood that if the user is interacting with the screen and both the iPhone and the VoIP app are in an active state, the VoIP app's processing would not be delayed. However, can significant delays (several seconds) in application processing still occur even when the iPhone is in an active state (i.e., the user is interacting with the screen)?"

We understood that if the user is interacting with the screen and both the iPhone and the VoIP app are in an active state, the VoIP app's processing would not be delayed. However, can significant delays (several seconds) in application processing still occur even when the iPhone is in an active state (i.e., the user is interacting with the screen)?"

Two questions:

  1. What thread does the timer target? The simplest way to delay timer firing is to block the runloop the timer is targeting.

  2. Have you set NSTimer.tolerance? While the documentation says that it defaults to "0", I'd suggest setting it to "0" yourself (assuming that what you want).

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

What thread does the timer target? The simplest way to delay timer firing is to block the runloop the timer is targeting.

Sometimes this delays occur, and sometimes they don't. Think of timers as targeting a dedicated call-controll processing thread and not blocking the run loop.

Have you set NSTimer.tolerance? While the documentation says that it defaults to "0", I'd suggest setting it to "0" yourself (assuming that what you want).

I also considered NSTimer.tolerance and, as per your suggestion, explicitly set it to 0. However, this had no discernible effect, likely because its default value is already 0. Given this, do you have any other suggestions for ensuring reliable timer firing?

About Delay issues with iPhone VoIP applications
 
 
Q