I do something similar like below. Shouldn&#39;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.<div>
<br></div><div><br><div><br><div><div>while [ 1 ]; do</div><div>    if ip=`wget -q -O - <a href="http://myip.dnsomatic.com">myip.dnsomatic.com</a>`; then</div><div>        if [ &quot;$ip&quot; == &quot;`cat $CACHE_DIR/last_ip_freeswitch`&quot; ]; then</div>
<div>            :  # do nothing</div><div>        else </div><div>            $log_info &quot;ip address has changed&quot;</div><div>            $log_info &quot;executing freeswitch profile restarts&quot;</div><div>            # reload freeswitch external profiles</div>
<div>            /usr/local/freeswitch/bin/fs_cli -x &#39;sofia profile remote_extensions rescan&#39; 2&gt;&amp;1 | $log_info</div><div>            /usr/local/freeswitch/bin/fs_cli -x &#39;sofia profile remote_extensions restart&#39; 2&gt;&amp;1 | $log_info</div>
<div><br></div><div>            /usr/local/freeswitch/bin/fs_cli -x &#39;sofia profile external rescan&#39; 2&gt;&amp;1 | $log_info</div><div>            /usr/local/freeswitch/bin/fs_cli -x &#39;sofia profile external restart&#39; 2&gt;&amp;1 | $log_info</div>
<div>            echo $ip &gt; $CACHE_DIR/last_ip_freeswitch</div><div>        fi</div><div><br></div><br><div class="gmail_quote">On Wed, Feb 8, 2012 at 12:30 PM, Brian West <span dir="ltr">&lt;<a href="mailto:brian@freeswitch.org">brian@freeswitch.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">#!/usr/bin/perl<br>
<br>
$ip = `/usr/bin/snmpget -c m00se -v1 192.168.1.1 IP-MIB::ipAdEntAddr.5 | /usr/bin/awk &#39;{print \$4}&#39;`;<br>
$ip =~ s/\n//g;<br>
chomp($ip);<br>
<br>
print &quot;&lt;include&gt;\n\t&lt;X-PRE-PROCESS cmd=\&quot;set\&quot; data=\&quot;external_ip=$ip\&quot;/&gt;\n&lt;/include&gt;\n&quot;;<br>
<br>
<br>
I do something like this in mine before.<br>
<br>
/b<br>
<div><div class="h5"><br>
On Feb 8, 2012, at 1:12 PM, Brian West wrote:<br>
<br>
&gt; You&#39;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&#39;t really depend on that in your case so you&#39;ll need to get creative to set your variables properly that get used down in the sofia configs to bind to the proper IP&#39;s.  This exercise is sadly left up to you to do.<br>

&gt;<br>
&gt; I use a script to write out some XML that gets included but if your IP changes you need to restart the sofia profiles.<br>
&gt;<br>
&gt; /b<br>
&gt;<br>
&gt; On Feb 8, 2012, at 12:35 PM, Anurag Srivastava wrote:<br>
&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;  Could anybody help with this.<br>
&gt;<br>
&gt; --<br>
&gt; Brian West<br>
&gt; FreeSWITCH Solutions, LLC<br>
&gt; Phone: <a href="tel:%2B1%20%28918%29%20420-9266" value="+19184209266">+1 (918) 420-9266</a><br>
&gt; Fax:   <a href="tel:%2B1%20%28918%29%20420-9267" value="+19184209267">+1 (918) 420-9267</a><br>
&gt; <a href="mailto:brian@freeswitch.org">brian@freeswitch.org</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
<br>
--<br>
Brian West<br>
FreeSWITCH Solutions, LLC<br>
Phone: <a href="tel:%2B1%20%28918%29%20420-9266" value="+19184209266">+1 (918) 420-9266</a><br>
Fax:   <a href="tel:%2B1%20%28918%29%20420-9267" value="+19184209267">+1 (918) 420-9267</a><br>
<a href="mailto:brian@freeswitch.org">brian@freeswitch.org</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
</div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards<br>Anurag <br>
</div></div></div>