iOS VoIP call does not work in background

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

We are using PJSIP in TCP mode and already configured keep alive.
Application running smoothly in background But after some time when App is
trying to re register with SIP server registration message has been sent
and app is not getting response,App is getting stuck at the time and then
it won't work any more in background. After killing it works OK. can anyone
advise what we are missing ?

Some time its work for 3-4 hours and some time it stop even in 5 minutes.



Running This code when app is background :



KEEP_ALIVE_INTERVAL is 600s.




- (void)applicationDidEnterBackground:(UIApplication *)application {

    [self performSelectorOnMainThread:@selector(keepAlive)
withObject:nil waitUntilDone:YES];

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

    int i;

    if (!pj_thread_is_registered()) {
        pj_thread_register("ipjsua", a_thread_desc, &a_thread);
    }

    /* Since iOS requires that the minimum keep alive interval is 600s,
     * application needs to make sure that the account's registration
     * timeout is long enough.
     */

    for (i = 0; i < (int)pjsua_acc_get_count(); ++i) {
        if (pjsua_acc_is_valid(i)) {
            pjsua_acc_set_registration(i, PJ_TRUE);
        }
    }

    pj_thread_sleep(15000);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140826/e27d0753/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux