DNS Lookup issue with pjsua_create()

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

 



Hi Tony,

This sounds a lot like the problem I was having a couple weeks ago with
pjsua_start() taking a long time to complete.

Samuel pointed me right to the solution, which involves changing one line in
the pjsip source.

<clip>
It seems there are some problem with pj_getaddrinfo on some devices or some
network/DNS configurations.

To fix your issue, you need to modify a little bit pj_gethostip function in
sock_common.c
    - replace line 789 : status = pj_getaddrinfo(af, pj_gethostname(),
&count, &ai);
    - by : status = PJ_ERESOLVE;

I believe if you use DNS resolution of pjsip, you shouldn't have this issue.
</clip>

Hope this does it for you,
Joe

On Wed, Jan 12, 2011 at 7:51 AM, Tony Million <tony at bababoo.com> wrote:

> I've been having a problem with a device running my iPhone app locking up.
> I've traced it back to line 657 of pjsua_core.c.
>
> The function is:
>
>   status = pjsip_endpt_create(&pjsua_var.cp.factory,
>                                pj_gethostname()->ptr,
>                                &pjsua_var.endpt);
>
> basically, the pj_gethostname() call is calling gethostname which is
> blocking the app for a significant length of time. Is there a reason this is
> used there or can the string be set to something else?
>
> Because pjsua_create() has to be called from the main thread it is making
> the UI of the application unresponsive until it times out, in my app every
> other call to pjsua is performed on a background thread, so this is not an
> issue for the Main thread (and thus the UI).
>
> Regards,
> --
> Tony Million
>
>
> _______________________________________________
> 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
>



-- 
Joe Meade
434.242.2685
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110112/2fe3c13a/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