0

I need some help with a design decision. I am currently building an iOS app that requires VoIP capabilities and I have some questions.

  1. I understand that iOS can only maintain a TCP connection in the background. If I have a RTP connection open during a call will that call be lost when the user enters the background? If so how does Skype and others do this?

  2. If I have to simply stream audio over TCP to keep a conversation going in the background, does anyone have a suggestion on how to keep the audio in sync in the event of the jitter buffer running empty during a call?

T.Leavy
  • 504
  • 5
  • 16

1 Answers1

1

Answer to (1):

iOS VoIP apps may keep a single TCP socket at background, usually your SIP socket, to allow incoming calls (INVITEs).

While your app has an active call, and goes to background, It has no restrictions, you can keep as many sockets as you want.

Here is a more detailed answer from another thread

Regarding the SIP stack implementation, you may want to check open-source PJSip stack

Community
  • 1
  • 1
Avishay Cohen
  • 2,418
  • 1
  • 22
  • 40
  • My only issue now is that the OS will still close the app regardless of my keepAlive to the server. Do you happen to know the specifics of what makes this happen. The socket stays open fine, and you can even call the app say 8 hours after it was closed. However, randomly it will die? – T.Leavy Aug 10 '12 at 23:55
  • Try checking crash logs, the system shouldn't stop your app, and when it crashes it will relaunch at background, so when your applicationDidFinishLaunching, you should check UIApplication state - If its in the background, recover your connection. Have you handled network reachability? If no network or network changes (Also while in background), socket may be closed and you need to reconnect. – Avishay Cohen Aug 12 '12 at 09:16
  • Wow, you were totally right. Found a bunch of crash logs. Thanks for your help – T.Leavy Aug 14 '12 at 04:55
  • No problem :) Another tip - when launched in background, ask for a background task in order to avoid getting suspended while you recover your connection – Avishay Cohen Aug 15 '12 at 17:26