<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">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>