<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p>indeed there is a pseudo-variable that gives the environment
variables. Moreover, iirc, Luis Azedo added a while ago (it may be
only from 5.3) support to resolve variables inside substdef (and
maybe define) -- so eventually you should be able to do this with
5.3.0:</p>
<p>#!substdef "/PUBLICIP/$env(KAMPUBLICIP)/"</p>
<p> listen=<a class="moz-txt-link-freetext" href="udp:$(local_ip):5060">udp:$(local_ip):5060</a> advertise "PUBLICIP":5060</p>
<p>It might not work for this specific case, because listen value is
a little bit complex definition, not just string values. But with
5.3 there is a command line parameter (-l -- lower case L) to
specify listen socket with advertise address. So just remove
listen from kamailio.cfg and the start kamailio like:</p>
<p>kamailio -l proto:localaddr:lcoalport/publicaddr:publicport</p>
<p>Like:</p>
<p>kamailio -l <a class="moz-txt-link-freetext" href="udp:10.0.0.1:5080/1.2.3.4:5060">udp:10.0.0.1:5080/1.2.3.4:5060</a><br>
</p>
<p>See kamailio -h for more details.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 24.10.19 09:28, Rick Barenthin
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAPriEK7FvDLQNZcpiA-__M58t_encWJEVEGA_GQsox_pX9y_7w@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">
<div>I've never used it but wiki says:
<div dir="auto"><br>
</div>
<div dir="auto">
<h2 style="padding:0px;line-height:1.2;margin:0px 0px
0.666em;color:rgb(51,51,51);font-family:arial,sans-serif">$env(NAME)
- environment variables</h2>
<div
style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px"
dir="auto">
<p style="margin:0px 0px 1.4em;padding:0px"><strong>$env(NAME)</strong> -
value of the environment variable named NAME</p>
</div>
</div>
So it should be possible.<br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Alex Balashov <<a
href="mailto:abalashov@evaristesys.com" target="_blank"
rel="noreferrer" moz-do-not-send="true">abalashov@evaristesys.com</a>>
schrieb am Do., 24. Okt. 2019, 08:16:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto">It is not. But you can do this via any
template system such as Jinja2, or a hand-rolled
substitution script.<br>
<br>
<div dir="ltr">—
<div>Sent from mobile, with due apologies for brevity
and errors.</div>
</div>
<div dir="ltr"><br>
<blockquote type="cite">On Oct 24, 2019, at 2:02 AM,
Gaurav Bmotra <<a
href="mailto:saigauravmehra91@gmail.com"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">saigauravmehra91@gmail.com</a>>
wrote:<br>
<br>
</blockquote>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">hi
<div>i using kamailio 5.2 </div>
<div>is it possible to use environmental variables
value in kamailio.cfg <br>
like i want to use local ip and public ip in
config file </div>
<div><br>
</div>
<div> listen=<a class="moz-txt-link-freetext" href="udp:$(local_ip):5060">udp:$(local_ip):5060</a> advertise
$(public_ip):5060<br clear="all">
<div>if iti is possible then how i can use this </div>
<div><br>
</div>
<div><br>
</div>
<div>thank you </div>
-- <br>
<div dir="ltr" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<font color="#999999"><b>Regards:</b><br>
Gaurav Kumar</font><br>
</div>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<span>_______________________________________________</span><br>
<span>Kamailio (SER) - Users Mailing List</span><br>
<span><a href="mailto:sr-users@lists.kamailio.org"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">sr-users@lists.kamailio.org</a></span><br>
<span><a
href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a></span><br>
</div>
</blockquote>
</div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
<a
href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
rel="noreferrer noreferrer noreferrer" target="_blank"
moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<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, Oct 21-23, 2019, Berlin, Germany -- <a class="moz-txt-link-freetext" href="https://asipto.com/u/kat">https://asipto.com/u/kat</a></pre>
</body>
</html>