Weird behaviour when handling interruption on iPhone

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

 



Yeah, the documentation isn't clear on this but:

Voip property - your application will wake up when activity happens on the TCP socket you have added the relevant property to - In my experience I've found the app to stay awake for around 10 seconds before being suspended after TCP activity.

Background Audio - as long as you have an OPEN audio channel your app will continue to operate (at a reduced priority) - In my experience iOS will suspend the app in somewhere between 500-4000 milliseconds after the audio is stopped. 

The problem you're running in to is that the incoming call is forcibly closing PJSips audio thus your voip app gets suspended. Luckily because yours was the foreground app before the call came in you get the CTCarrier call begin/end and you can appropriately deal with putting the call on hold.

Be aware of a "got-cha" I ran into during development, if you attempt to take the call off hold and resume the audio in PJSip as soon as you return to the app and get the callEventHandler telling you the call ended you will often end up with 1 way audio. Seems the internal phone app is slow to release the audio and thus PJSip can't restart the recording. Stick a performSelectorAfterDelay with a wait of 500-1000ms in the internal call end callback then take the call off hold.

Thanks,
Tony. 

On Aug 18, 2011, at 8:52 AM, Fadi Chehimi wrote:

> I expected this is the case but thought if i set the following attributes in the app.plist file it would be kept running in the bg, but it seems that is not the case at the end:
> 
> Required background modes:
> - App provides Voice over IP services
> - App plays audio
> 
> Many thanks for your replies 
> AF
> 
> 
> 
> On Thu, Aug 18, 2011 at 4:39 PM, Tony Million <tony at bababoo.com> wrote:
> You have to do hold via the server.
> 
> Because the incoming call takes over the audio on the iPhone when your voip app is sent to the background (because the incoming call has forced it there) after several seconds the app is suspended by iOS.
> 
> Tony.
> 
> 
> On Aug 18, 2011, at 8:31 AM, Fadi Chehimi wrote:
> 
> > Hi Sebastian
> >
> > Thanks for your reply.
> > I did this as well at the beginning, but did not include it in my email, and managed to get notified and put the call on hold then re-invite. But, as i mentioned in my email above, my implementation of the hold function plays a wav file on the receiver's end rather than using the one by the SIP-server. And once the event-block is reached, the call is put on hold and the wav file is played for a short time, then it stops on the receiver's end, and then i get the native dialler with the incoming call information on my end (the caller). Not sure what forced the wav file to stop but i suspect it is something to do with PJSIP's internal interruption handling.
> >
> > Cheers
> > AF
> >
> >
> >
> >
> > On Thu, Aug 18, 2011 at 3:51 PM, <s.marek at avm.de> wrote:
> > I did that from a totally different perspective:
> >
> > CTCallCenter gives you a callback-block for call events. Each time a GSM
> > call is established or terminated, your code is executed.
> >
> > I simply put my current VoIP call on hold, when a GSM call starts and
> > reinvite my VoIP call, when the GSM call ends.
> >
> > The SIP-Server is then responsible for playing something to the other VoIP
> > party (usually a nice female voice stating: "Please hold the line ...").
> > Was easy and worked for me.
> >
> > Sebastian.
> >
> >
> > pjsip-bounces at lists.pjsip.org schrieb am 18.08.2011 14:45:31:
> >
> > | I am trying to handle interruptions by incoming GSM call in my
> > | iPhone application when i am on a VoIP call.
> >
> > _______________________________________________
> > 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
> >
> >
> >
> > --
> > -------------------------------------
> > Fadi Chehimi, PhD
> > Mobile Software Engineer
> > Localphone Ltd
> > 4 Paradise Street, Sheffield, S1 2DF, UK
> >
> >
> > _______________________________________________
> > 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
> 
> 
> 
> -- 
> -------------------------------------
> Fadi Chehimi, PhD
> Mobile Software Engineer
> Localphone Ltd
> 4 Paradise Street, Sheffield, S1 2DF, UK
> 
> 
> _______________________________________________
> 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




[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