WWDC and iPhone 4

DT
Darald Trinka
Mon, May 24, 2010 9:09 PM

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@divitas.com

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@divitas.com
SV
Samuel Vinson
Tue, May 25, 2010 8:16 AM

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@divitas.com


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

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@divitas.com > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > >
AG
Angelica Grace Tanchico
Wed, Jun 16, 2010 10:50 AM

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@laposte.net
To: pjsip@lists.pjsip.org
Subject: Re: [pjsip] 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@divitas.com


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969

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@laposte.net > To: pjsip@lists.pjsip.org > Subject: Re: [pjsip] 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@divitas.com > > > > > > > > > > _______________________________________________ > > Visit our blog: http://blog.pjsip.org > > > > pjsip mailing list > > pjsip@lists.pjsip.org > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _________________________________________________________________ Hotmail: Trusted email with powerful SPAM protection. https://signup.live.com/signup.aspx?id=60969
DT
Darald Trinka
Mon, Jun 21, 2010 5:25 PM

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@laposte.net
To: pjsip@lists.pjsip.org
Subject: Re: [pjsip] 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@divitas.com


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@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@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

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@laposte.net > > To: pjsip@lists.pjsip.org > > Subject: Re: [pjsip] 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@divitas.com > > > > > > > > > > > > > > > _______________________________________________ > > > Visit our blog: http://blog.pjsip.org > > > > > > pjsip mailing list > > > pjsip@lists.pjsip.org > > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > > > > > > > > > > > _______________________________________________ > > Visit our blog: http://blog.pjsip.org > > > > pjsip mailing list > > pjsip@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@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
FP
Fabio Pietrosanti (naif)
Tue, Jun 22, 2010 8:48 AM

Hi Darald,

are you wrapping all the TCP and TLS related functions of PJSIP to the
standard iOS ones?

A clean layer a-la'-pjlib way would be really welcome!

Fabio

On 21/06/10 19.25, Darald Trinka wrote:

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.

Hi Darald, are you wrapping all the TCP and TLS related functions of PJSIP to the standard iOS ones? A clean layer a-la'-pjlib way would be really welcome! Fabio On 21/06/10 19.25, Darald Trinka wrote: > > 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. > >
DT
Darald Trinka
Tue, Jun 22, 2010 10:26 AM

I'm not sure yet, but doing this cleanly would be my approach. We hope to look into this in a couple of weeks - after we update our server to use tcp.

On Jun 22, 2010, at 4:48 AM, "Fabio Pietrosanti (naif)" lists@infosecurity.ch wrote:

Hi Darald,

are you wrapping all the TCP and TLS related functions of PJSIP to the standard iOS ones?

A clean layer a-la'-pjlib way would be really welcome!

Fabio

On 21/06/10 19.25, Darald Trinka wrote:

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.

I'm not sure yet, but doing this cleanly would be my approach. We hope to look into this in a couple of weeks - after we update our server to use tcp. On Jun 22, 2010, at 4:48 AM, "Fabio Pietrosanti (naif)" <lists@infosecurity.ch> wrote: > Hi Darald, > > are you wrapping all the TCP and TLS related functions of PJSIP to the standard iOS ones? > > A clean layer a-la'-pjlib way would be really welcome! > > Fabio > > On 21/06/10 19.25, Darald Trinka wrote: >> >> >> 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. >> >> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
AG
Angelica Grace Tanchico
Tue, Jun 22, 2010 11:20 AM

Hi Darald,

"iOS is able to maintain a tcp socket when the app is suspended
(in the background)"

-> Can iOS maintain UDP socket when app is suspended o not (that's why you need change to tcp socket in you server and client)?

From: dtrinka@gmail.com
To: pjsip@lists.pjsip.org
Date: Tue, 22 Jun 2010 06:26:41 -0400
CC: pjsip@lists.pjsip.org
Subject: Re: [pjsip] WWDC and iPhone 4

I'm not sure yet, but doing this cleanly would be my approach. We hope to look into this in a couple of weeks - after we update our server to use tcp.

On Jun 22, 2010, at 4:48 AM, "Fabio Pietrosanti (naif)" lists@infosecurity.ch wrote:

Hi Darald,

are you wrapping all the TCP and TLS related functions of PJSIP to the
standard iOS ones?

A clean layer a-la'-pjlib way would be really welcome!

Fabio

On 21/06/10 19.25, Darald Trinka wrote:

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.


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969

Hi Darald, "iOS is able to maintain a tcp socket when the app is suspended (in the background)" -> Can iOS maintain UDP socket when app is suspended o not (that's why you need change to tcp socket in you server and client)? From: dtrinka@gmail.com To: pjsip@lists.pjsip.org Date: Tue, 22 Jun 2010 06:26:41 -0400 CC: pjsip@lists.pjsip.org Subject: Re: [pjsip] WWDC and iPhone 4 I'm not sure yet, but doing this cleanly would be my approach. We hope to look into this in a couple of weeks - after we update our server to use tcp. On Jun 22, 2010, at 4:48 AM, "Fabio Pietrosanti (naif)" <lists@infosecurity.ch> wrote: Hi Darald, are you wrapping all the TCP and TLS related functions of PJSIP to the standard iOS ones? A clean layer a-la'-pjlib way would be really welcome! Fabio On 21/06/10 19.25, Darald Trinka wrote: 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. _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _________________________________________________________________ Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. https://signup.live.com/signup.aspx?id=60969
DT
Darald Trinka
Tue, Jun 22, 2010 12:31 PM

They are not able to maintain UDP sockets in the background. I talked to several iOS networking engineers at WWDC about this issue. They stated that we could file a "bug". I don't plan to do this, instead we are switching to TCP.

One other piece of information that isn't covered in Apple's multitasking doc is that if you install a SCNetworkReachability observer you will be notified when the network interface changes from wifi to cell data and visa-versa even if you are in the background. I haven't personally verified this...

Best regards,
Darald

On Jun 22, 2010, at 7:20 AM, Angelica Grace Tanchico wrote:

Hi Darald,

"iOS is able to maintain a tcp socket when the app is suspended (in the background)"

-> Can iOS maintain UDP socket when app is suspended o not (that's why you need change to tcp socket in you server and client)?

From: dtrinka@gmail.com
To: pjsip@lists.pjsip.org
Date: Tue, 22 Jun 2010 06:26:41 -0400
CC: pjsip@lists.pjsip.org
Subject: Re: [pjsip] WWDC and iPhone 4

I'm not sure yet, but doing this cleanly would be my approach. We hope to look into this in a couple of weeks - after we update our server to use tcp.

On Jun 22, 2010, at 4:48 AM, "Fabio Pietrosanti (naif)" lists@infosecurity.ch wrote:

Hi Darald,

are you wrapping all the TCP and TLS related functions of PJSIP to the standard iOS ones?

A clean layer a-la'-pjlib way would be really welcome!

Fabio

On 21/06/10 19.25, Darald Trinka wrote:

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.


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up now._______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

They are not able to maintain UDP sockets in the background. I talked to several iOS networking engineers at WWDC about this issue. They stated that we could file a "bug". I don't plan to do this, instead we are switching to TCP. One other piece of information that isn't covered in Apple's multitasking doc is that if you install a SCNetworkReachability observer you will be notified when the network interface changes from wifi to cell data and visa-versa even if you are in the background. I haven't personally verified this... Best regards, Darald On Jun 22, 2010, at 7:20 AM, Angelica Grace Tanchico wrote: > Hi Darald, > > "iOS is able to maintain a tcp socket when the app is suspended (in the background)" > > -> Can iOS maintain UDP socket when app is suspended o not (that's why you need change to tcp socket in you server and client)? > > From: dtrinka@gmail.com > To: pjsip@lists.pjsip.org > Date: Tue, 22 Jun 2010 06:26:41 -0400 > CC: pjsip@lists.pjsip.org > Subject: Re: [pjsip] WWDC and iPhone 4 > > I'm not sure yet, but doing this cleanly would be my approach. We hope to look into this in a couple of weeks - after we update our server to use tcp. > > On Jun 22, 2010, at 4:48 AM, "Fabio Pietrosanti (naif)" <lists@infosecurity.ch> wrote: > > Hi Darald, > > are you wrapping all the TCP and TLS related functions of PJSIP to the standard iOS ones? > > A clean layer a-la'-pjlib way would be really welcome! > > Fabio > > On 21/06/10 19.25, Darald Trinka wrote: > > 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. > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up now._______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org