Hi All,

I have been struggling with this issue for a long and could not find a way to solve it. I have setup FreeSWITCH and Kamailio on the single server but on a private server with a private IP and fronted by firewall. Firewall has all the ports opened.

FreeSWITCH is running with nonat. Kamailio has public IP advertised on port 5060 and private IP on 5070 for phones on LAN. Problem is with outbound calls there is no audio and reason I can see is contact field in SDP has the private IP of the server instead of the public IP.

Internal device to device calls is working fine. I have tried to rewrite the SDP and have written below code, but got no success:

request_route
{
        xlog("L_DBG", "Request Route Enter");
        if (is_method("INVITE"))
        {
                xlog("L_DBG", "Request Route Enter in Invite");
                if (has_body("application/sdp"))
                {
                        xlog("L_DBG", "Request Route Enter in SDP of Invite");
                        if (search("IN IP4 PRIVATE_IP"))
                        {
                                xlog("L_DBG", "Request Route Search IN IP4 PRIVATE_IP");
                                fix_nated_sdp("8", "PUBLIC_IP");
                                fix_nated_sdp("2", "PUBLIC_IP");
                        }
                }
        }
}

Can anyone help me to get rid of this.

Thanks,
Anurag Mishra