<p></p>
<h3>Description</h3>
<p>I tried to use the <code>$env(NAME)</code> pseudovariable as argument for <code>modparam()</code> calls but evidently the result was empty.</p>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<p>Set up <code>auth_ephemeral</code> and add this to your configuration:</p>
<pre><code>modparam("auth_ephemeral", "secret", "$env(AUTH_EPHEMERAL_SECRET)")
</code></pre>
<p>Now export <code>AUTH_EPHEMERAL_SECRET=something</code> and start Kamailio with sufficient debug output. You'll see that Kamailio literally uses <code>$env(AUTH_EPHEMERAL_SECRET)</code> as secret instead of inserting the value of the environment variable.</p>
<h4>Log Messages</h4>
<pre><code>kamailio_1  | 17(23) DEBUG: auth_ephemeral [authorize.c:136]: do_auth(): secret: $env(AUTH_EPHEMERAL_SECRET) (27)
</code></pre>
<h3>Possible Solutions</h3>
<p>Replacement of environment variables should be supported in <code>modparams()</code>. (And possibly in <em>all</em> functions.)</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.2.1 (x86_64/linux) 
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown 
compiled with gcc 5.3.1

</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>$ uname -a
Linux e2193249aa45 4.4.0-128-generic #154-Ubuntu SMP Fri May 25 14:15:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
</code></pre>
<p>(Using the Docker image <code>kamailio/kamailio:5.2.1-xenial</code> ATM.)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2276">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZL5T26N3ANKTZDQBA3RLMY3LANCNFSM4MDE4KVA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZPR45CJJY3XO3FCZGLRLMY3LA5CNFSM4MDE4KVKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4I4EYRPQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2276",
"url": "https://github.com/kamailio/kamailio/issues/2276",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>