<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
Hi Daniel,</div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
<br>
</div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
I figured it's related to the way I start kamailio, using sudo.</div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
<br>
</div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
My kamailio version is 5.5.x</div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
<br>
</div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
But I am confused what you mean by next construction is not supported because it seems to be working if I use </div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
<br>
</div>
<div id="ms-outlook-mobile-signature" dir="auto">
<div dir="auto"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">#!ifdef DEVSTAGE == "dev"</span><br>
</div>
<div dir="auto"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;"><br>
</span></div>
<div dir="auto"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">Regards,</span></div>
<div dir="auto"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">Adarsh </span></div>
<div dir="auto"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;"><br>
</span></div>
Get <a href="https://aka.ms/AAb9ysg">Outlook for Android</a></div>
<div id="id-53e37102-3a52-48d6-825c-100fb59c81b5" class="ms-outlook-mobile-reference-message">
<div style="font-family: sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg"><strong>From:</strong> Daniel-Constantin Mierla <miconda@gmail.com><br>
<strong>Sent:</strong> Wednesday, 22 September, 2021, 11:50 am<br>
<strong>To:</strong> Kamailio (SER) - Users Mailing List; Adarsh Chauhan<br>
<strong>Subject:</strong> Re: [SR-Users] Unable to pull enviornment variables<br>
</div>
<br>
<meta content="text/html; charset=utf-8">
<p>Hello,</p>
<p>what version of Kamailio do you use? How do you start Kamailio?</p>
<p>Anyhow, note that the next construction is not supported:<br>
</p>
<p>#!ifdef DEVSTAGE == "dev"</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 21.09.21 11:13, Adarsh Chauhan wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi Team,
<div><br>
</div>
<div>Need some help here.</div>
<div>Want to pull environment variable however kamailio just doesnt pick it.</div>
<div><br>
</div>
<div>I exported the environment variable</div>
<div><b>export STAGE="dev"</b></div>
<div><br>
</div>
<div>Then i tried following</div>
<div>1)</div>
<div><b>#!defenv DEVSTAGE</b></div>
<div>gives error</div>
<div> 0(3809) ERROR: <core> [core/cfg.lex:2085]: pp_define_env(): env variable not defined [DEVSTAGE] </div>
<div><br>
</div>
<div>2) </div>
<div><b>#!substdef "/DEVSTAGE/$env(DEVSTAGE)/";</b><br>
</div>
<div><br>
</div>
<div>
<div dir="ltr" class="gmail_signature">
<div dir="ltr"> 0(3962) DEBUG: <core> [core/ppcfg.c:87]: pp_subst_add(): ### added subst expression: [/DEVSTAGE/$env(DEVSTAGE)/]<br>
 0(3962) DEBUG: <core> [core/cfg.lex:1964]: pp_define(): defining id: DEVSTAGE<br>
 0(3962) DEBUG: <core> [core/parser/parse_fline.c:249]: parse_first_line(): first line type 1 (request) flags 1<br>
 0(3962) DEBUG: <core> [core/parser/msg_parser.c:677]: parse_msg(): SIP Request:<br>
 0(3962) DEBUG: <core> [core/parser/msg_parser.c:679]: parse_msg():  method:  <OPTIONS><br>
 0(3962) DEBUG: <core> [core/parser/msg_parser.c:681]: parse_msg():  uri:     <<a href="mailto:sip%3Ayou@kamailio.org">sip:you@kamailio.org</a>><br>
 0(3962) DEBUG: <core> [core/parser/msg_parser.c:683]: parse_msg():  version: <SIP/2.0><br>
 0(3962) DEBUG: <core> [core/parser/parse_hname2.c:293]: parse_sip_header_name(): parsed header name [Via] type 1<br>
 0(3962) DEBUG: <core> [core/parser/parse_via.c:2639]: parse_via(): end of header reached, state=2<br>
 0(3962) DEBUG: <core> [core/parser/msg_parser.c:555]: parse_headers(): Via found, flags=2<br>
 0(3962) DEBUG: <core> [core/parser/msg_parser.c:557]: parse_headers(): this is the first via<br>
 0(3962) DEBUG: <core> [core/pvapi.c:497]: pv_spec_lookup(): PV <$env(DEVSTAGE)> is not in cache<br>
 0(3962) DEBUG: <core> [core/pvapi.c:335]: pv_cache_add(): PV cache not initialized, doing it now<br>
 0(3962) DEBUG: <core> [core/pvapi.c:371]: pv_cache_add(): pvar [$env(DEVSTAGE)] added in cache<br>
 0(3962) DEBUG: <core> [core/cfg.lex:2053]: pp_define_set(): ### setting define ID [DEVSTAGE] value [<null>] (mode: 1)<br>
 0(3962) DEBUG: <core> [core/ppcfg.c:188]: pp_substdef_add(): ### added substdef: [DEVSTAGE]=[<null>] (0)<br>
 0(3962) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1<br>
 0(3962) DEBUG: <core> [core/re.c:504]: subst_str(): no match<br>
 0(3962) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1<br>
 0(3962) DEBUG: <core> [core/re.c:504]: subst_str(): no match<br>
<div><br>
</div>
<div><br>
</div>
<div>my end goal is to compare the directive and load modules accordingly.</div>
<div><b>#!ifdef DEVSTAGE == "dev"</b><br>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <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 - Online
Nov 08-11, 2021 (Europe Timezone) - Nov 22-25, 2021 (America Timezone)
  * <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
<br>
</div>
</body>
</html>