I have two running SIP applications on a Debian buster server, one app use port 1000 (a softphone) and another one using port 2000 (VoIP server like FreePBX). both of them are on the same machine and OS. I want to connect these two applications together on the same server via port bridging. I used "SOCAT" but when SOCAT running the apps can not connect to the ports due to the port being opened by socat.
socat TCP4-LISTEN:1000,reuseaddr TCP4-LISTEN:2000,reuseaddr
is there any other way to connect these two ports on localhost? or can SOCAT listen to the port in another way like sniffing?
socat
command would listen on both ports and expect that both ends connect to the respective port. Is this right? I assume that your FreePBX acting as a SIP server will listen on port 2000 and your SIP client implemented with PJSIP will connect to port 1000. In the latter case you would need simple port forwarding. But why don't you configure/program one of FreePBX/PJSIP to use the matching port? In the first case FreePBX seems to act as a client and I doubt that you can connect to SIP clients usingsocat
. This is what SIP servers do.