[Freeswitch-users] external_sip_ip not refreshed after ip address change.

Anurag Srivastava asrivas at gmail.com
Thu Feb 9 02:16:36 MSK 2012


I do something similar like below. Shouldn't this be done by freeswitch
itself? After an ip change, i do notice that external_rtp_ip is correctly
got from stun, but external_sip_ip is still set to its old value at load
time.



while [ 1 ]; do
    if ip=`wget -q -O - myip.dnsomatic.com`; then
        if [ "$ip" == "`cat $CACHE_DIR/last_ip_freeswitch`" ]; then
            :  # do nothing
        else
            $log_info "ip address has changed"
            $log_info "executing freeswitch profile restarts"
            # reload freeswitch external profiles
            /usr/local/freeswitch/bin/fs_cli -x 'sofia profile
remote_extensions rescan' 2>&1 | $log_info
            /usr/local/freeswitch/bin/fs_cli -x 'sofia profile
remote_extensions restart' 2>&1 | $log_info

            /usr/local/freeswitch/bin/fs_cli -x 'sofia profile external
rescan' 2>&1 | $log_info
            /usr/local/freeswitch/bin/fs_cli -x 'sofia profile external
restart' 2>&1 | $log_info
            echo $ip > $CACHE_DIR/last_ip_freeswitch
        fi


On Wed, Feb 8, 2012 at 12:30 PM, Brian West <brian at freeswitch.org> wrote:

> #!/usr/bin/perl
>
> $ip = `/usr/bin/snmpget -c m00se -v1 192.168.1.1 IP-MIB::ipAdEntAddr.5 |
> /usr/bin/awk '{print \$4}'`;
> $ip =~ s/\n//g;
> chomp($ip);
>
> print "<include>\n\t<X-PRE-PROCESS cmd=\"set\"
> data=\"external_ip=$ip\"/>\n</include>\n";
>
>
> I do something like this in mine before.
>
> /b
>
> On Feb 8, 2012, at 1:12 PM, Brian West wrote:
>
> > You'll need to understand how FreeSWITCH works.  that external_sip_ip
> variable is probably fake and in vars.xml and is setup to stun:
> something... You can't really depend on that in your case so you'll need to
> get creative to set your variables properly that get used down in the sofia
> configs to bind to the proper IP's.  This exercise is sadly left up to you
> to do.
> >
> > I use a script to write out some XML that gets included but if your IP
> changes you need to restart the sofia profiles.
> >
> > /b
> >
> > On Feb 8, 2012, at 12:35 PM, Anurag Srivastava wrote:
> >
> >> Hi,
> >>  Could anybody help with this.
> >
> > --
> > Brian West
> > FreeSWITCH Solutions, LLC
> > Phone: +1 (918) 420-9266
> > Fax:   +1 (918) 420-9267
> > brian at freeswitch.org
> > http://www.freeswitch.org
> >
>
> --
> Brian West
> FreeSWITCH Solutions, LLC
> Phone: +1 (918) 420-9266
> Fax:   +1 (918) 420-9267
> brian at freeswitch.org
> http://www.freeswitch.org
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>



-- 
Regards
Anurag
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120208/0b36e541/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list