<div dir="ltr">Hello Guys,<div><br></div><div>I was already told about using the "inline" when setting a variable, which actually did set it, but i can't then use it, for some reason..</div><div><br></div><div>
This is my dialplan</div><div><br></div><div><div><span style="white-space:pre-wrap">        </span><condition field="destination_number" expression="^.*"></div></div><div><br></div><div><div><span style="white-space:pre-wrap">                </span><action inline="true" application="set" data="rand_val=${expr(randomize(&x);ceil(random(0,100,&x)))}"/></div>
<div><span style="white-space:pre-wrap">                </span><action application="log" data="INFO Random value is ${rand_val}"/></div><div><span style="white-space:pre-wrap">                </span><action inline="true" application="set" data="auth_call=${cond(${rand_val} < 41 ? YES : NO )}"/> </div>
<div><span style="white-space:pre-wrap">                </span><action application="log" data="INFO Result: ${auth_call}"/></div><div><br></div><div><span style="white-space:pre-wrap">                </span><condition field="${auth_call}" expression="^YES$"></div>
<div><span style="white-space:pre-wrap">                        </span><action application="log" data="INFO ASR 40 we got ${rand_val}"/></div></div><div><div><span style="white-space:pre-wrap">                </span><anti-action application="log" data="INFO ${auth_call} is not greater than 41"/></div>
<div><span style="white-space:pre-wrap">                </span></condition></div><div><span style="white-space:pre-wrap">        </span></condition></div></div><div><br></div><div>and the Log:</div><div><br></div><div>
<div><div>EXECUTE sofia/external/<a href="mailto:12345@1.2.3.4">12345@1.2.3.4</a> log(INFO cond(19 < 41 ? YES : NO ) is not greater than 41)</div><div>2013-09-02 17:57:27.090531 [INFO] mod_dptools.c:1567 cond(19 < 41 ? YES : NO ) is not greater than 41</div>
<div>EXECUTE sofia/external/<a href="mailto:12345@1.2.3.4">12345@1.2.3.4</a> log(INFO Random value is 19)</div><div>2013-09-02 17:57:27.090531 [INFO] mod_dptools.c:1567 Random value is 19</div><div>EXECUTE sofia/external/<a href="mailto:12345@1.2.3.4">12345@1.2.3.4</a> log(INFO Result: cond(19 < 41 ? YES : NO ))</div>
<div>2013-09-02 17:57:27.090531 [INFO] mod_dptools.c:1567 Result: cond(19 < 41 ? YES : NO )</div><div>2013-09-02 17:57:27.090531 [NOTICE] switch_core_state_machine.c:262 sofia/external/<a href="mailto:12345@1.2.3.4">12345@1.2.3.4</a> has executed the last dialplan instruction, hanging up.</div>
<div>2013-09-02 17:57:27.090531 [NOTICE] switch_core_state_machine.c:264 Hangup sofia/external/<a href="mailto:12345@1.2.3.4">12345@1.2.3.4</a> [CS_EXECUTE] [NORMAL_CLEARING]</div></div></div><div><br></div><div><br></div>
<div>Apparently the <condition field="${auth_call}" expression="^YES$"> is not working...</div><div><br></div><div>Can you guys help?</div><div><br></div><div>Thanks!</div><div><br></div><div>David</div>
</div>