linphone-developers
[Top][All Lists]
Advanced

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

Re: [Linphone-developers] Background mode handling in iOS


From: Jehan Monnier
Subject: Re: [Linphone-developers] Background mode handling in iOS
Date: Sat, 29 Oct 2011 21:28:39 +0200

Hi Ivan,



Le 26 oct. 2011 à 23:40, Ivan Sergeyenko a écrit :

> Hi all,
> 
> I'm looking at the "entering background mode" section of iOS porting
> documentation 
> (http://mirror.csclub.uwaterloo.ca/nongnu/linphone/docs/liblinphone/modules.html).
> It's describing what should be done very clearly, but _why_ one must
> do all these things is a lot less clear.
> 
> We start off with the following:
> 
> //First refresh registration
> linphone_core_refresh_registers(theLinphoneCore);
> 
> OK, I can understand that. We want to make sure that we refresh the
> registration before the first keepalive handler is scheduled (up to)
> 10 minutes later. But the next few lines completely baffle me:
> 
> //wait for registration answer
> int i=0;
> while (!linphone_proxy_config_is_registered(proxyCfg) && i++<40 ) {
>     linphone_core_iterate(theLinphoneCore);
>     usleep(100000);
> }
> 
> Why do we need this while loop? Is it because we want to make sure
> that the registration is completed before we try to re-register
> (keepalive handler might get fired as soon as it is registered). Is
> that really necessary? Even if we prevent this from occurring the
> first time around, nothing is preventing the second handler to restart
> registration while the first handler's registration is still in
> progress.
> 
> In any case, even if this code really is necessary, do the constants
> (40 and 100000) have some special meaning or they're just chosen
> arbitrarily?
> 
> Any explanation would be greatly appreciated!
> 

The purpose of this code is to wait until the registration refresh succeed, 
specially because the register will probably be challenged by the SIP proxy. 
Without this code, Linphone will going to standby before having enough time to 
answer the 401/407 response.
Yes 40 an 10000 are arbitrary

> Thanks,
> Ivan Sergeyenko
> 

Cheers

> _______________________________________________
> Linphone-developers mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/linphone-developers




reply via email to

[Prev in Thread] Current Thread [Next in Thread]