WSS Audio issue in freeswitch behind a NAT

81 Views Asked by At

I am using WSS for implementing sip.js in FreeSWITCH. Here, WSS runs on port 7443.

Below are the parameters I added on the FreeSWITCH side.

    tls             =   true
    wss-binding :7443
    tls-cert-dir    =  /etc/freeswitch/tls/
    tls-version     =  $${sip_tls_version}
    tls-bind-params =  transport=tls

So our flow is sip.js(user) > WSS > FS

In this flow, I am encountering stability issues, and at times, I experience WSS connectivity problems.

To avoid this case I am attempting to insert Nginx between sip.js (user), WSS, and the FreeSWITCH server. The new flow should be as follows: sip.js (user) > WSS > Nginx > FS.

With this new flow, the stability issue has been resolved and the system works well when FreeSWITCH operates on a public IP. However, in our scenario where the server is behind a NAT, I am encountering audio loss issues.

NGINX configuration.

    location /phone {
        proxy_pass http://127.0.0.1:<FREESWITCH WS PORT>;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $host;
        proxy_read_timeout 120s;
        proxy_send_timeout 120s;
        client_body_timeout 120s;
        send_timeout 120s;
    }

I attempted to use 127.0.0.1, private IP, and public IP in the proxy_pass configuration. However, when running on 127.0.0.1, it is not working, and when setting the private or public IP, I encounter audio issues on the FreeSWITCH side.

I believe there are some issues with IP or port mapping on the server, but I have no clue how to resolve this problem. Can anyone please help me solve this issue or maybe show me a direction to look for?

Thank you for reading.

0

There are 0 best solutions below