WWDC and iPhone 4

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

 



PJSip 1.6 builds out of the box on iOS 4 GM. When running in the foreground, its able to register, make and receive calls in ideal conditions without problem.


Most of the background issues are handled in your application rather than in the PJ framework. This document, from Apple, covers the needed changes: http://developer.apple.com/iphone/prerelease/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html


In order to be woken up to send a keep alive message do something like this in your UIApplicationDelegate:

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    NSLog(@" The applicationDidEnterBackground");

    [application setKeepAliveTimeout:600 handler: ^{
        NSLog(@" The applicationDidEnterBackground: FIRED");
    }];
}

The send-keep-alive block is empty because we run PJ in a separate thread. When the app is woken up, the PJ thread auto sends a keep alive message as it's timer has already expired.

Our current timeout to 600 seconds (the minimum), but the Apple engineers told me that 28 mins should be fine (assuming you use TCP rather than UDP for SIP).


iOS is able to maintain a tcp socket when the app is suspended (in the background). This allows an app to receive incoming SIP packets. I've only done a cursory look into this, but it does appear that PJSIP will need to be changed to support this. Instead of using bsd sockets, NSInputStream or CFReadStreamRef will need to be used. We haven't dug into this yet, as our client and server use UDP for SIP transport - we are updating this now.


Hope that helps,
Darald


On Jun 16, 2010, at 6:50 AM, Angelica Grace Tanchico wrote:

> Hello,
> 
> I have the same problem. I need my app with backgrounding support for iphone os4.
> I need help on what will be the function inside the keep alive handler of the UIApplication. 
> Is not the default keep-alive function of the pjsip enough? Also I'm confused on how to
> configure sockets using high-level constructs for the pjsip to work. I really need help.
> 
> Thanks in advance!
> 
> Regards,
> Angie
> 
> 
> > Date: Tue, 25 May 2010 10:16:07 +0200
> > From: samuelv@xxxxxxxxxxx
> > To: pjsip at lists.pjsip.org
> > Subject: Re: WWDC and iPhone 4
> > 
> > Hi,
> > 
> > I won't go to WWDC, but pjsip should work on iPhone OS 4.0 without 
> > modifications.
> > However you need to manage some specific things in your app. Declare 
> > VoIP app, manage keep alive message to keep 3G/wifi connection up.
> > 
> > Regards
> > 
> > Samuel
> > 
> > Le 24/05/10 23:09, Darald Trinka a ?crit :
> > > Hi,
> > >
> > > I've been digging around various PJ related sources to find the status of the port to iPhone v4.0. Is there an on going effort to update PJ to run in the background - e.g. accept incoming calls, send keep alive, and play audio while in the background? I will be at WWDC and would love to meet with anyone working on this task or has worked on the iPhone port.
> > >
> > >
> > > Thanks,
> > >
> > > Darald Trinka
> > > Software Architect
> > > DiVitas Networks
> > > darald.trinka at divitas.com
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > Visit our blog: http://blog.pjsip.org
> > >
> > > pjsip mailing list
> > > pjsip at lists.pjsip.org
> > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> > >
> > >
> > > 
> > 
> > 
> > _______________________________________________
> > Visit our blog: http://blog.pjsip.org
> > 
> > pjsip mailing list
> > pjsip at lists.pjsip.org
> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> 
> Hotmail: Trusted email with powerful SPAM protection. Sign up now._______________________________________________
> Visit our blog: http://blog.pjsip.org
> 
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20100621/6372c156/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