I think i have all the requirements to have an "alive" socket while the app is in background. That is to say:
- My application has voip and audio as its background modes.
- I'm using PJSIP as the SIP library, which is supposed to use CFReadStreams with the "Run in Background" property enabled
- The app is using TCP to establish the connection with the SIP server.
When the application is sent to background, it adds a background handler which sends a "keepAlive" message each period of time.
That keepAlive seems to be working. If I check the logs in the server I can see how messages arrive even when the application is not in foreground.
The problem ( and the question ) is, I'm not receiving calls while the application is in background.
It seems that the socket is still alive, if I make a call to the cell phone while the app is no in the foreground, nothing happens, but if I launch the app by myself, the call is automatically detected.
Thanks :)