<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>I ended up using $HN().</div>
<div><br>
</div>
<div><a href="https://www.kamailio.org/wiki/cookbooks/4.2.x/pseudovariables#hn_key_-_hostname_details">https://www.kamailio.org/wiki/cookbooks/4.2.x/pseudovariables#hn_key_-_hostname_details</a></div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>"<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>" <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Monday, July 3, 2017 at 1:03 AM<br>
<span style="font-weight:bold">To: </span>"Kamailio (SER) - Users Mailing List" <<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>>, Henry Fernandes <<a href="mailto:henry@usinternet.com">henry@usinternet.com</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [SR-Users] host to get name of local server<br>
</div>
<div><br>
</div>
<div>
<div text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<br>
<div class="moz-cite-prefix">On 29.06.17 18:11, Henry Fernandes wrote:<br>
</div>
<blockquote type="cite" cite="mid:D57A82CE.13AD76%25henry@usinternet.com">
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family:
        Calibri, sans-serif;">
We have multiple Kamailio 4.4.x servers and I am setting up stats tracking.  I would like to track the stats for each individual Kamailio server separately like so:</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family:
        Calibri, sans-serif;">
<br>
</div>
<blockquote style="color: rgb(0, 0, 0); font-size: 14px; margin:
        0px 0px 0px 40px; border: none; padding: 0px;">
<div>
<div><span style="font-family: Courier;">kamailio_1.sip.register.count</span></div>
</div>
<div>
<div><span style="font-family: Courier;">kamailio_</span><span style="font-family: Courier;">2.sip.register.count</span></div>
</div>
<div>
<div><span style="font-family: Courier;">kamailio_</span><span style="font-family: Courier;">3.sip.register.count</span></div>
</div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
</blockquote>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family:
        Calibri, sans-serif;">
The problem is that we use one common file (in version control) for our Kamailio configuration.  Thus, I can’t just hardcode the hostname into the file because it will be the same for each server.</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family:
        Calibri, sans-serif;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family:
        Calibri, sans-serif;">
Does anyone have a solution for me?  Is there a variable that provides the hostname or is there something else I can do?</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family:
        Calibri, sans-serif;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family:
        Calibri, sans-serif;">
Ideally, I’d love to be able to do something like this.</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family:
        Calibri, sans-serif;">
<br>
</div>
<blockquote style="margin: 0px 0px 0px 40px; border: none;
        padding: 0px;">
<div><font face="Courier">statsd_incr($host_name + “.sip.register.count");</font></div>
</blockquote>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family:
        Calibri, sans-serif;">
<br>
</div>
</blockquote>
<br>
one option would be to define it via command line parameter with -A option. Your start script can set it using the usual shell scripts.<br>
<br>
Cheers,<br>
Daniel<br>
<pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</div>
</div>
</span>
</body>
</html>