PJSIP 1.7 - iOS 4

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

 



  Hello Darald,

I don't think the issue comes from sending notification on main thread.
iOS seems to close all udp socket when application is in background and 
the screen is locked.

Regards

Samuel


Le 09/08/10 19:32, Darald Trinka a ?crit :
> I don't know if this is strictly needed or not (I didn't try it 
> without), but you may need to send the notification from the main 
> thread. For example:
>
> *    dispatch_async(dispatch_get_main_queue(),
> *    ^{
>         localNotif.alertBody = label;
>
>         localNotif.alertAction = NSLocalizedString(answer, nil);
>         localNotif.soundName = @"default_ringtone.caf";
>         localNotif.userInfo = [NSDictionary dictionaryWithObject:
>                 @"incomingCall" forKey:@"reason"];
>
>         [app presentLocalNotificationNow:localNotif];
>         [localNotif release];
>     });
>
> On Aug 8, 2010, at 6:55 PM, Samuel Vinson wrote:
>
>> Hi Darald,
>>
>> I tried your solution and mine, they work in all cases except one.
>> My app runs in background and the iphone is locked. When pjsip 
>> receive an incoming call, one LocalNotification is sent from 
>> on_incoming_call callback.
>> If the user anwsers, the application:didReceiveLocalNotification: is 
>> called by iOS. In this function, I call pjsua_call_answer(cid, 200, 
>> null,null), but the function stays locked in pj_mutex_lock
>>
>> Calls stack :
>> pjsua_call_answer -> pjsip_inv_answer -> process_answer -> 
>> inv_negotiate_sdp -> pjsua_call_on_media_update -> 
>> pjsua_media_channel_update -> pjmedia_session_create -> 
>> pjmedia_stream_create -> pjmedia_transport_attach -> transport_attach 
>> -> pj_ioqueue_lock_key(rtp_key) ->pj_mutex_lock (-> 
>> pthread_mutex_lock ->semaphoe_wait_signal -> semaphore_wait_signal_trap)
>>
>> I use the last version og svn trunk.
>>
>> Had you got the same issue ?
>> How did you resolve it ?
>>
>> Thanks for you help.
>>
>> Regards
>>
>> Samuel
>>
>> Le 02/08/10 16:47, Darald Trinka a ?crit :
>>> We have been seriously working on adding iOS4 background support to 
>>> PJ 1.6 for about a month now. Here is a summary of where we are at.
>>>
>>> Most of the background issues are addressed at the application level 
>>> not in PJ. See this Apple document to address them: 
>>> https://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html. 
>>> That is, keeping an *active *voip call alive while in the 
>>> background; waking up the application to re-register/send a keep 
>>> alive messages; and using UILocalNotification with your 
>>> UIApplicationDelegate to display incoming call notifications.
>>>
>>> The main change we made to PJ is to support incoming SIP messages 
>>> while the app is suspended in the background. The changes mainly 
>>> focuses on wrapping the bsd-socket as a 
>>> CFReadStreamRef/CFWriteStreamRef - attached is a summary of the 
>>> changes. Note: using UDP for sip is not supported by iOS 4, if you 
>>> want to receive incoming call notifications while in the background. 
>>> Warning, these changes have *NOT *been committed back into the 
>>> project nor have they been rigorously tested. We tried to do this in 
>>> the cleanest way possible and to minimize the impact to the existing 
>>> code.
>>>
>>> Now that we can have iOS4 background support we are seeing an issue 
>>> we need help with.
>>>
>>> - After making a voip call, iOS still thinks there is an active voip 
>>> call - meaning it displays the double red "on call" status bar. It 
>>> appears that PJ 1.6 doesn't properly close the mic and/or speaker. 
>>> We use pjsua_call_hangup_all to terminate calls...
>>>
>>>
>>> Best regards,
>>> Darald Trinka
>>>
>>>
>>> On Aug 2, 2010, at 7:27 AM, Benny Prijono wrote:
>>>
>>>> 1.7 should be out in the next few days, sorry for the delay!
>>>>
>>>> iOS4 background exec support is another story though. While we want to
>>>> support it as soon as possible, there's no definite timeline for it
>>>> yet.
>>>>
>>>> Cheers,
>>>>  Benny
>>>>
>>>> On Mon, Aug 2, 2010 at 6:04 AM, fred mcclain 
>>>> <fmcclain at boojummobile.com <mailto:fmcclain at boojummobile.com>> wrote:
>>>>> I second both of these questions! Particularly will 1.7 support iPhone
>>>>> background execution?
>>>>> Thanks,
>>>>> Fred
>>>>> On Aug 1, 2010, at 2:58 PM, Maunil Sanghavi wrote:
>>>>>
>>>>> Hi,
>>>>> Is there an approximate timeline for when 1.7 is going to be 
>>>>> released? Also
>>>>> when do you expect to support iPhone background execution?
>>>>> Thanks,
>>>>> Maunil
>>>>> _______________________________________________
>>>>> Visit our blog: http://blog.pjsip.org <http://blog.pjsip.org/>
>>>>>
>>>>> pjsip mailing list
>>>>> pjsip at lists.pjsip.org <mailto:pjsip at lists.pjsip.org>
>>>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Visit our blog: http://blog.pjsip.org <http://blog.pjsip.org/>
>>>>>
>>>>> pjsip mailing list
>>>>> pjsip at lists.pjsip.org <mailto:pjsip at lists.pjsip.org>
>>>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Visit our blog: http://blog.pjsip.org <http://blog.pjsip.org/>
>>>>
>>>> pjsip mailing list
>>>> pjsip at lists.pjsip.org <mailto: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
>>
>
>
> _______________________________________________
> 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/20100809/f89d2862/attachment-0001.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