gethostbyname() errors with pjsua2/pjsip on multihomed system

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

 



This is the first time I've used pjsip/pjsua2 on a multihomed system but I
noticed that when setting an AccountConfig's
`mediaConfig.transportConfig.publicAddress` and/or
`mediaConfig.transportConfig.boundAddress` to the IP address of the correct
network interface (on Linux), I see errors when the call media comes in:

ERROR: Unable to resolve transport bind address: gethostbyname() has
returned error (PJ_ERESOLVE) [status=70018]
ERROR: Unable to create RTP/RTCP socket: gethostbyname() has returned error
(PJ_ERESOLVE) [status=70018]
ERROR: Error creating media transport: gethostbyname() has returned error
(PJ_ERESOLVE)
ERROR: Error initializing media channel: gethostbyname() has returned error
(PJ_ERESOLVE) [status=70018]
ERROR: pjsua_call_answer2(id, param.p_opt, prm.statusCode, param.p_reason,
param.p_msg_data) error: gethostbyname() has returned error (PJ_ERESOLVE)
(status=70018) [../src/pjsua2/call.cpp:490]

If I don't set those values, the call "works" but no RTP packets are
received because it's listening on the wrong network interface (I verified
this by checking the address used in the SDP sent by pjsip).

Setting the TransportConfig's `publicAddress` and `boundAddress` of the
Transport to the *same IP address* works just fine and is bound correctly.
I verified that by looking at the pjsip debug output.

I have even tried adding a hostname to /etc/hosts that points to the IP
address, and once again that works for the signalling address but not the
media address.

Making the same call to `gethostbyname()` from say a Python script works
just fine, whether I pass the same network interface IP or the "fake"
hostname, so I'm not sure why pjsip is having such a problem.

I'm not using ICE/STUN/TURN/etc. because it's not a NAT issue, these calls
are all happening on the same local network. pjsua2 works just fine on our
systems with only one network interface.

It would be nice if pjsip showed the resulting `herror()` when
`gethostbyname()` returns NULL. I tried adding this and other debug
messages myself but for some reason I never see my printf()s in the console
after recompiling and reinstalling from source.

If anyone has any suggestions or ideas, I would appreciate it as I am
really at a dead end here.

Thanks

- Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20150318/96653c96/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