[OpenSER-Users] Exposing the NIC IP's in openser.cfg

Robert Dyck rob.dyck at telus.net
Tue Dec 18 21:53:56 CET 2007


I have been using openser as an ALG for the purpose of NAT traversal. 
Unfortunately my public IP is dynamically assigned. Although openser is aware 
of the IP's available on the host, I have searched unsuccessfully the 
documentation for a way to expose this information to the configuration 
script.

Have I missed something?

I am using the following ugly work around.

DHCP client writes to /var/openser/my-ip

From the rtpproxy init script - 
OPTIONS="-l 192.168.1.1/`cat /var/openser/my_ip` -s udp:localhost:12221"

from openser.cfg -
route{
# get our public ip, this happens only once
if !$var(ip_initialized) == "yes"
        {                         
xlog("L_NOTICE", "****************************************************\n");
        xlog("L_NOTICE", "*** Initializing the IP for masquerading SIP 
Contact\n");
        exec_avp("cat /var/openser/my_ip", "$avp(s:pub_ip)");
        pv_printf("$var(my_ip)", "$avp(s:pub_ip)");
        xlog("L_NOTICE", "*** New public IP is <$var(my_ip)>\n");
        $var(ip_initialized) = "yes";
        };

mangle contacts




More information about the Users mailing list