Background mode working only when i launch my app from xCode.

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

 



to confirm that my stettings are good i changed this function to add logs:








static void activesock_create_iphone_os_stream(pj_activesock_t *asock)
{
    if (ios_bg_support && asock->bg_setting && asock->stream_oriented) 
    {
        activesock_destroy_iphone_os_stream(asock);


        CFStreamCreatePairWithSocket(kCFAllocatorDefault, asock->sock,
				     &asock->readStream, NULL);


        if (!asock->readStream ||
	    CFReadStreamSetProperty(asock->readStream,
				    kCFStreamNetworkServiceType,
				    kCFStreamNetworkServiceTypeVoIP)
	    != TRUE ||
	    CFReadStreamOpen(asock->readStream) != TRUE)
        {
	    PJ_LOG(2,("", "Failed to configure TCP transport for VoIP "
		      "usage. Background mode will not be supported."));
	    
	    activesock_destroy_iphone_os_stream(asock);
        }
        else
        {
            PJ_LOG(2,("", "Success to configure TCP transport for VoIP "
                      "usage. Background mode will be supported."));   
        }
    }
    else
    {
        PJ_LOG(2,("", "Background mode is NOT enabled."));
    }
}
in the log i see "Success to configure TCP transport for VoIP ..." when i start my test app from xcode..
Best Regards,

From: ash.x.ash@xxxxxxxxxxx
To: pjsip at lists.pjsip.org
Date: Tue, 17 Jan 2012 13:23:15 -0500
Subject: Background mode working only when i launch my app from	xCode.







Hello all,
 
I am using PJSIP 1.12.. I did not run any special config when I compiled 
the libraries.. just compile for ARM6 and ARM7 then merge.. I am trying to get 
background working so:
 
-  I used TCP instead of UDP as my protocol.
 
-  I checked PJ_ACTIVESOCK_TCP_IPHONE_OS_BG and PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT in OS_autu.h and I see both of the defined as 1. I see both of them 
defined in a ?#if 
defined(PJ_DARWINOS) && PJ_DARWINOS!=0? so I did not 
change anything...

-  I added Required Background mode flag into my test App plist 
file
 
When I launch my app from xcode by hitting the play button, then  I 
press home on the device to put the app in background mode I see the my 
registration function gets called every 60 seconds as expected. and when I call 
the device I  hit the on_incomming_call event as expected.... 
 
 
But when I launch the app from the device itself just click on its icon the 
background does not work.. if I tried to call the device after 60 seconds, 
Astersik will say the device is not registered which mean the background socket 
did not respond to the Keep alive thing between the server and the 
device..
 
 
if I removed the plist entry about background mode It does not work in both 
cases (launch from xcode and launch from device), so I think I am on the right 
path...
 
 
Am I missing something else?? I have been researching this issue an I am 
not sure what is missing?
 
Thanks,,,

_______________________________________________
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/20120117/a027bc6f/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