somleng / freeswitch-config

FreeSWITCH config for Somleng
MIT License
8 stars 7 forks source link

Configure public IP in SDP #9

Closed dwilkie closed 7 years ago

dwilkie commented 7 years ago

This function checks if NAT is applied.

First it checks whether extsipip is set AND that the local IP is not in the loopback AND that the local IP is not in the local network

Don't add local IP to loopback!!

// /src/mod/endpoints/mod_sofia/sofia_glue.c
int sofia_glue_check_nat(sofia_profile_t *profile, const char *network_ip)
{
        switch_assert(network_ip);

        return (profile->extsipip &&
                        !switch_check_network_list_ip(network_ip, "loopback.auto") &&
                        !switch_check_network_list_ip(network_ip, profile->local_network));
}