Error creating audio sockets

Hi,

Going to negotiate audio…
Allocating audio ports:
Intercepting message (663 bytes)
Intercepting message (393 bytes)
[204E5C6ED2C22FC8E6EB2E4D99A07ADC][nua_r_register]: 200 OK
Successfully registered
[ERR] [plugins/janus_sip.c:janus_sip_allocate_local_ports:6641] Error creating audio sockets…
[ERR] [plugins/janus_sip.c:janus_sip_handler:3580] Could not allocate RTP/RTCP ports

This start happening with Use getaddrinfo instead of gethostbyname commit.

No apparent errors while loading Janus. AudioBridge, SIP plugin and other loaded. Janus detected Local IP. This is Debian based docker build without IPv6. As far as I can see, SIP register going through, but INVITE fail while reading RTP/RTCP fd.

No, that’s not a failure reading, it’s a failure creating the RTP/RTCP sockets. Try adding this after line 6616:

if(session->media.audio_rtp_fd == -1)
	JANUS_LOG(LOG_ERR, "Error creating RTP socket: (error=%s)\n", g_strerror(errno));

and this after line 6633:

if(session->media.audio_rtcp_fd == -1)
	JANUS_LOG(LOG_ERR, "Error creating RTCP socket: (error=%s)\n", g_strerror(errno));

and do a new make install. This should tell you if it’s the call to the socket() system call that’s failing for some reason.

[ERR] [plugins/janus_sip.c:janus_sip_allocate_local_ports:6618] Error creating RTP socket: (error=Address family not supported by protocol)
[ERR] [plugins/janus_sip.c:janus_sip_allocate_local_ports:6637] Error creating RTCP socket: (error=Address family not supported by protocol)
[ERR] [plugins/janus_sip.c:janus_sip_allocate_local_ports:6645] Error creating audio sockets…
[ERR] [plugins/janus_sip.c:janus_sip_handler:3580] Could not allocate RTP/RTCP ports


I guess this is expected as there is no IPv6 on this host?

Yeah, that may be it, even though the lack of IPv6 addresses on the server should not be an issue: it’s more of a problem if IPv6 is entirely disabled, IIRC, or at least that’s what we found out in an old issue. For RTP forwarders we fixed that in a dedicated PR, where we added a check to see if creating IPv6 sockets failed or not: I’ll try adding the same to the SIP plugin to see if that fixes it.

Can you create an issue in Github so that I can reference it in the PR, as soon as it’s ready?

@Fuad I’ve just created a PR to try and fix this behaviour:

Could you let me know if it fixes the issue for you?

It works, the call went through and everything seems to be ok. I’ll test a bit more tomorrow, and I’ll let you know if I notice any issues. Thank you.

1 Like

@Fuad any update on your tests? Can I merge the PR?

Calls going fine, I didn’t notice any issue.

1 Like