IOS voip app not responding in background after 5 minutes

I am developing a VOIP application for iOS (7 and 8) (using the Kamailio server and the PJSIP device library).

Everything works fine when the application is in the foreground, but the problem is that the application is in the background, the socket will remain alive for only 5 minutes (300 seconds).
When I register with:

[application setKeepAliveTimeout:600 handler: ^{
        [self performSelectorOnMainThread:@selector(keepAlive) withObject:nil waitUntilDone:YES];
    }];

I can get a call.

The problem setKeepAliveTimeoutis 10 minutes, and the socket only lasts 5 minutes.

I have included "The application provides voice over IP services" in .plist. I also set PJSUA_REG_INTERVALin 600 seconds.
Please help me install the VIOP socket in PJSIP.

+4
source share
2

VoIP , ,

CFReadStreamSetProperty((__bridge_retained CFReadStreamRef)iStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP);
0

NAT - .

keep-alive PJSIP :

pjsip_cfg()->tcp.keep_alive_interval = 90;
pjsip_cfg()->tls.keep_alive_interval = 90;

, , iOS keep-alive.

0

All Articles