<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=WordSection1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Oh, I forgot to answer you're last question &#8230;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The 'dnl' deletes the newline after the 'define'.&nbsp; The
solution I just posted takes the output from the curl command and trims off the
newline.&nbsp;&nbsp; The regexp() m4 command seems like a little overkill but I
didn't find a better way to do it.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I have a very complex (but powerful) m4 configuration that
supports 6 different production sites.&nbsp; It allows me to maintain a single
configuration that it tailored each site by a simple m4 command during
installation.&nbsp; Yes, the quoting in m4 can be hairy but I've found it to be
much more effective than using bash, perl or python.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hope that helps!<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
users-bounces@lists.opensips.org [mailto:users-bounces@lists.opensips.org] <b>On
Behalf Of </b>Daniel Goepp<br>
<b>Sent:</b> Thursday, September 30, 2010 4:45 PM<br>
<b>To:</b> OpenSIPS users mailling list<br>
<b>Subject:</b> Re: [OpenSIPS-Users] Config include file<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>Sorry for asking an m4 question
here, but it kinda relates to getting a config going for OpenSIPS, and you guys
seem to know all about it ;)&nbsp; I almost have my test working here, very
simple to start:<br>
<br>
My m4 file:<br>
<br>
define(`_OPENSER_HOST',esyscmd(`curl -s <a href="http://checkip.dyndns.org/">http://checkip.dyndns.org/</a>
| grep -o &quot;[[:digit:].]\+&quot;'))dnl<br>
advertise_address=&quot;_OPENSER_HOST&quot;<br clear=all>
<br>
But this generates:<br>
<br>
advertise_address=&quot;67.218.120.85<br>
&quot;<br>
<br>
My understanding from reading the m4 page is that dnl should be trimming the
carriage return on the end of the curl response.&nbsp; But it doesn't appear to
be.&nbsp; Thoughts?<br>
<br>
Thanks<br>
<br>
-dg<br>
<br>
<o:p></o:p></p>

<div>

<p class=MsoNormal>On Thu, Sep 30, 2010 at 1:49 PM, Daniel Goepp &lt;<a
href="mailto:dan@goepp.net">dan@goepp.net</a>&gt; wrote:<o:p></o:p></p>

<p class=MsoNormal>Just found this:<br>
<br>
<a href="http://snippets.dzone.com/posts/show/7256" target="_blank">http://snippets.dzone.com/posts/show/7256</a><br>
<br>
Which has:<br>
<br>
curl -s <a href="http://checkip.dyndns.org/" target="_blank">http://checkip.dyndns.org/</a>
| grep -o &quot;[[:digit:].]\+&quot;<br>
<br>
It works!<br>
<br>
So I'm thinking combining this with uname -a, you guys might have a better
solution here.&nbsp; Going to test now :)<br>
<br>
Thanks!<br clear=all>
<span style='color:#888888'><br>
-dg</span><o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><br>
<br>
<o:p></o:p></p>

<div>

<p class=MsoNormal>On Thu, Sep 30, 2010 at 1:43 PM, Daniel Goepp &lt;<a
href="mailto:dan@goepp.net" target="_blank">dan@goepp.net</a>&gt; wrote:<o:p></o:p></p>

<p class=MsoNormal>I'm definitely familiar with back tick and how this command
works, I was just mentioning that the information I need to provide, the system
doesn't know.&nbsp; I could however merge some of these comments, and just have
a file on each server that is it's public ip, and execute `cat
my_public_ip.txt`&nbsp; However, after more investigation, some of our boxes do
have other differences, for example I just noticed that our 64bit vs 32bit
systems have different mpaths.&nbsp; I'm sure we could get more fancy with
executing these commands, check the OS, and set accordingly.&nbsp; This is very
useful information, but for simplicity for now, I think we'll just stick with
the original m4 suggestion.<br clear=all>
<br>
Thanks all.<br>
<span style='color:#888888'><br>
-dg</span><o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><br>
<br>
<o:p></o:p></p>

<div>

<p class=MsoNormal>On Thu, Sep 30, 2010 at 1:23 PM, Brett Nemeroff &lt;<a
href="mailto:brett@nemeroff.com" target="_blank">brett@nemeroff.com</a>&gt;
wrote:<o:p></o:p></p>

<p class=MsoNormal>The point is, inside the ticks `` you place a shell command
that returns whatever you want there.. :)<o:p></o:p></p>

<div>

<p class=MsoNormal>-Brett<o:p></o:p></p>

</div>

<div>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>On Thu, Sep 30, 2010 at 3:07 PM, Daniel Goepp &lt;<a
href="mailto:dan@goepp.net" target="_blank">dan@goepp.net</a>&gt; wrote:<o:p></o:p></p>

<p class=MsoNormal>Unfortunately the hostname is not what we are using, but
rather a public IP address which is on the other side of NAT, so the proxies
are not aware of what it is.&nbsp; I believe the m4 solution posted earlier
will meet our need though for now, but thanks for the feedback, this is a
creative solution ;)<br clear=all>
<span style='color:#888888'><br>
-dg</span><o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><br>
<br>
<o:p></o:p></p>

<div>

<p class=MsoNormal>On Thu, Sep 30, 2010 at 1:00 PM, Pauba, Kevin L &lt;<a
href="mailto:KLPauba@west.com" target="_blank">KLPauba@west.com</a>&gt; wrote:<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>define(`_OPENSER_HOST',`regexp(esyscmd(`hostname
-f'),`\&lt;.+\&gt;',\&amp;)')dnl</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>&#8230;</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>alias=&quot;_OPENSER_HOST&quot;</span><o:p></o:p></p>

<div style='border:none;border-bottom:solid windowtext 1.0pt;padding:0in 0in 1.0pt 0in;
border-color:-moz-use-text-color -moz-use-text-color windowtext'>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>Take special note of the backquote (`).</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p>

<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;
border-color:-moz-use-text-color -moz-use-text-color'>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span
style='font-size:10.0pt'>From:</span></b><span style='font-size:10.0pt'> <a
href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>
[mailto:<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>]
<b>On Behalf Of </b>Brett Nemeroff<br>
<b>Sent:</b> Thursday, September 30, 2010 12:22 PM<br>
<b>To:</b> OpenSIPS users mailling list<br>
<b>Subject:</b> Re: [OpenSIPS-Users] Config include file</span><o:p></o:p></p>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Check
out m4:<o:p></o:p></p>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><a
href="http://www.opensips.org/Resources/DocsTools" target="_blank">http://www.opensips.org/Resources/DocsTools</a><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>&nbsp;<o:p></o:p></p>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On
Thu, Sep 30, 2010 at 12:19 PM, Daniel Goepp &lt;<a href="mailto:dan@goepp.net"
target="_blank">dan@goepp.net</a>&gt; wrote:<o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>We have
many proxies that have an identical configuration other than their public IP
address.&nbsp; We set this IP address only for a few things:<br>
<br>
In the global parameters:<br>
advertised_address<br>
<br>
Then in our routes for:<br>
record_route_preset<br clear=all>
rtpproxy_offer<br>
rtpproxy_answer<br>
<br>
What I would like to do is create a file on each of these servers (or a DB)
that contains that servers public IP, and then put something like an include
into the script.&nbsp; This would make managing our config a lot easier.&nbsp;
So each system would have an identical config and could be updated very
easily.&nbsp; Does this make sense?&nbsp; Any comments on how this might be
done?<br>
<br>
Thanks<br>
<span style='color:#888888'><br>
-dg<br>
</span><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></p>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p>

</div>

</div>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>