<p></p>
<h3 dir="auto">Description</h3>
<p dir="auto">Currently, an undefined environmental variable with <code>#!defenv</code> results in Kamailio failing to start. The proposal here that if the environmental variable is not defined, then the macro value would be undefined as well. For example:</p>
<pre><code>!#KAMAILIO
loadmodule "xlog"
loadmodule "pv"
#!defenv FOO
request_route {
#!ifdef FOO
xlog("L_INFO","Environmental variable $$FOO is set\n");
#!else
xlog("L_WARN","Environmental variable $$FOO is NOT set\n");
#!endif
forward();
}
</code></pre>
<p dir="auto">Currently this configuration will fail to load if environmental variable is not set. My proposal is to either allow <code>#!envdef</code> to accept an undefined environmental variable and have the preprocessor macro undefined, or to add a new keyword (<code>#!envdefn</code> perhaps?) to allow this behavior.</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/2967">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZIZEGOZIMBWIQALDXLUP6BULANCNFSM5JUHEPQQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/ABO7UZK55AQTJTONT7KUEL3UP6BULA5CNFSM5JUHEPQ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4QANAZSA.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/2967",
"url": "https://github.com/kamailio/kamailio/issues/2967",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>