How does session timer work for iOS when app is in background?

Q
qiulang
Fri, Sep 28, 2012 9:57 AM

I recently discovered an interesting behavior of session expiration
timer (pjsip_timer_setting) for iOS when app is in background. But I
could not figure out why.

So when I make a sip call there are 2 cases that will put my app into
background, either I hit Home button or I receive an incoming phone
call. From app point of view I thought they are the same,
applicationWillResignActive: and applicationDidEnterBackground: will be
called then app will be put into background and won't be executed
anymore until it is waken up again (leave alone keepalive message for
the time being).

Then I find that if I answer a phone call what happens is what I just
described, so when session timer expires my sip session is ended. But
when I hit Home button, when session timer expires my app will send out
UPDATE message to keep my session alive so my sip session won't die.
But how come!

When app is in background iOS won't run it anymore; how come it can
continually send out UPDATE message ? And why that only happens in the
case I hit Home button.

Thanks!

Qiulang

I recently discovered an interesting behavior of session expiration timer (pjsip_timer_setting) for iOS when app is in background. But I could not figure out why. So when I make a sip call there are 2 cases that will put my app into background, either I hit Home button or I receive an incoming phone call. From app point of view I thought they are the same, applicationWillResignActive: and applicationDidEnterBackground: will be called then app will be put into background and won't be executed anymore until it is waken up again (leave alone keepalive message for the time being). Then I find that if I answer a phone call what happens is what I just described, so when session timer expires my sip session is ended. But when I hit Home button, when session timer expires my app will send out UPDATE message to keep my session alive so my sip session won't die. But how come! When app is in background iOS won't run it anymore; how come it can continually send out UPDATE message ? And why that only happens in the case I hit Home button. Thanks! Qiulang
Q
qiulang
Sat, Mar 23, 2013 7:14 AM

Hi,

I don't know where I got this function nat_addr_changed, (seems in
version 1.12 but I am not sure). But it seems that it is not used
anymore, right ?

If so, how do we handle nat address changed ?

Thanks!

Qiulang

Hi, I don't know where I got this function *nat_addr_changed*, (seems in version 1.12 but I am not sure). But it seems that it is not used anymore, right ? If so, how do we handle nat address changed ? Thanks! Qiulang