Actually the fix above is invalid. The correct fix is: In sock_common.c in pj_gethostip() look for: status = pj_getaddrinfo(af, pj_gethostname(), &count, &ai); and modify to: status = PJ_ERESOLVE; //pj_getaddrinfo(af, pj_gethostname(), &count, &ai); That will fix this issue. On 25/03/2010, at 8:06 PM, Joseph Rukshan Fonseka wrote: > I have now confirmed that commenting out those lines fixes this issue! > And from quick inspection it seems like calling pj_gethostip() in init_random_seed() is unimportant. > Siphon now connects immediately to my local WiFi that has no internet connectivity. > > > > > On 25/03/2010, at 7:52 PM, Joseph Rukshan Fonseka wrote: > >> How important is the call to pj_gethostip() in init_random_seed() in pjsua_core.c ? >> >> It seems that if i comment out these lines, it resolves the issue below: >> >> /* Add primary IP address */ >> // if (pj_gethostip(pj_AF_INET(), &addr)==PJ_SUCCESS) >> //seed = pj_hash_calc(seed, &addr.ipv4.sin_addr, 4); >> >> >> On 25/03/2010, at 7:38 PM, Joseph Rukshan Fonseka wrote: >> >>> More info. >>> >>> Turns out that the 5mins or so is spent on the function >>> >>> rc = getaddrinfo(nodecopy, NULL, &hint, &res); >>> >>> which is in pj_getaddrinfo() in Addr_resolv_sock.c >>> >>> Any idea why this function take a long time on the iphone to execute when there is no internet connectivity >>> on the local WiFi? >>> >>> >>> On 25/03/2010, at 4:01 PM, Joseph Rukshan Fonseka wrote: >>> >>>> I have been debugging this more. Here are the diferences: >>>> >>>> WiFi with internet connectivity: >>>> pjsua_create() executes quite quick >>>> REGISTER message is sent almost immediately on call to pjsua_acc_add >>>> >>>> WiFI without internet connectivity: >>>> pjsua_create() takes a while to execute but is successful >>>> REGISTER message is not set out immediately on a call to pjsua_acc_add as in above scenario however this function returns success. But it turns out that we do get a REGISTER sent eventually it takes 5 minutes for that to happen. Then after 5 minutes everything is all good and Siphon/PJSIP works as expected after that and you can receive and make calls. >>>> >>>> Anyone know what the problem might be? >>>> >>>> >>>> On 24/03/2010, at 8:13 PM, Joseph Rukshan Fonseka wrote: >>>> >>>>> Hi All, >>>>> >>>>> I have been debugging Siphon and why it does not connect to the SIP client. >>>>> The scenario is a PABX running on my laptop, and my laptop and iPhone are connected via a local WiFI. >>>>> There is no internet connectivity on this WiFi (that is the key difference in which PJSIP fails to connect, if there was internet connectivity in the WiFi all is ok). >>>>> >>>>> I have debugged and in Siphon there is absolutely no difference between a WiFI that has internet connectivity or not. >>>>> The same lines of code are executed. However the difference seems to be in PJSIP. >>>>> >>>>> In PJSIP the function sip_startup() takes ages to execute in the case where I use a local WiFi with no internet. >>>>> However all the returns seem ok and indicates success, eventually it gets to call pjsua_acc_add(). >>>>> >>>>> Now in the scenario where there is internet connectivity in the WiFi, a call to that function sends out the REGISTER command (I verified using WireShark). However in the case where there is no internet connectivity, it executes and thinks its successful but there is no REGISTER command sent out at all. >>>>> >>>>> Does anyone know where PJSIP has a known limitation with respect to local WiFi with no internet connectivity or whether this is a known bug? >>>>> >>>>> Thanks in advance. >>>>> >>>>> Rukshan Fonseka. >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20100326/70c73dcb/attachment.html>