meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
7.98k stars 2.45k forks source link

[1.x] SIP plugin "Couldn't connect audio RTP? -- 22 (Invalid argument)" #3370

Closed Pineappluh closed 1 month ago

Pineappluh commented 1 month ago

What version of Janus is this happening on? 1.2.3

Have you tested a more recent version of Janus too? It's the latest version.

Was this working before? No.

Is there a gdb or libasan trace of the issue? Max level debug logs: https://pastebin.com/4SBywC8E

Additional context I'm on macOS Sonoma (version 14.41). I'm trying to create a PoC where I connect a softphone from the browser to a FreeSwitch we have running in our VPN. I am running Janus locally on my machine and I set up the softphone using JS SIP demo code. I'm able to register as a client to the FreeSwitch fine. However, when I make a call (I'm using audio only), I can hear audio, but I can't send any audio as I'm seeing the audio error.

lminiero commented 1 month ago

I don't use MacOS so I don't know what it is that it doesn't like. It may be our usage of sockaddr_storage, since I seem to remember MacOS not liking using the same socket for both IPv4 and IPv6. Try changing the sizeof(struct sockaddr_storage) that is in the connect() calls to sizeof(struct sockaddr_in), since I see IPv4 is being used in your case. If that fixes it, we'll see how we can prepare a proper fix.

Pineappluh commented 1 month ago

I've tried doing that now, but I'm still getting the same error. Any other ideas?

lminiero commented 1 month ago

Did you do a make install after editing the code? If so, then no, I don't have other ideas, as I don't know which of the fields connect on MacOS thinks are illegal. They're definitely fine on Linux.

Pineappluh commented 1 month ago

I did, it was recompiled. I'm not the best with C, but I guess I'll try to dig and find the root cause myself. If any other ideas come up please let me know

Pineappluh commented 1 month ago

I decided to run the gateway in Docker with a Linux distro instead and it works now! Fixing the issue was too difficult