<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<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"
cite="mid:CAJ72=0AkUx9eHaJ+EcbqzjD+Zv9O3jfgyOKPsEeTRnZeqjRE0g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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"
data-smartmail="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"
moz-do-not-send="true">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" wrap="">__________________________________________________________
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>
</body>
</html>