<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 24, 2017 at 3:30 PM, Антон Сацкий <span dir="ltr"><<a href="mailto:satskiy.a@gmail.com" target="_blank">satskiy.a@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Got a strange situation</div><div><br></div><div><div>[ext-queues]</div><div>...</div><div>exten => h,2,ExecIf($[${CALLERID(num)} = ' ']?Set(var29=${SHELL(curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{\"Phone\": ${FROMEXTEN}, \"Source\": \"asterisk\"}" "<a href="http://sIte.com:80/api/v1/calls?apiKey=UABVAEI&clientId=3" target="_blank">http://sIte.com:80/api/v1/<wbr>calls?apiKey=UABVAEI&clientId=<wbr>3</a>")}))<br></div><div><br></div><div>exten => h,3,NoOp(${var29})</div><div>exten => h,4,Macro(hangupcall,)</div><div>;--== end of [ext-queues] ==--;</div></div><div><br></div><div><br></div><div>so when i execute  it got</div><div><br></div><div><br></div><div><div>-- Executing [h@ext-queues:1] NoOp("SIP/100-00000050", "100") in new stack</div><div>    -- Executing [h@ext-queues:2] ExecIf("SIP/100-00000050", "<font color="#ff0000">0</font>?Set(var29=[{"<wbr>RequestedCount":0,"<wbr>MissedCount":7,"Total":7}])") in new stack</div><div>    -- Executing [h@ext-queues:3] NoOp("SIP/100-00000050", "") in new stack</div><div>    -- Executing [h@ext-queues:4] Macro("SIP/100-00000050", "hangupcall,") in new st</div></div><br clear="all"><div><br></div><div>U can see  that Execif = 0 = falce   but   somehow</div><div>Shell <font color="#0000ff">${SHELL(curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{\"Phone\": ${FROMEXTEN}, \"Source\": \"asterisk\"}" "<a href="http://sIte.com:80/api/v1/calls?apiKey=UABVAEI&clientId=3" target="_blank">http://sIte.com:80/api/v1/<wbr>calls?apiKey=UABVAEI&clientId=<wbr>3</a>")} </font> </div><div> executes and  get answer  from the server   <font color="#0000ff">[{"RequestedCount":0,"<wbr>MissedCount":7,"Total":7}]</font></div></div></blockquote><div><br></div><div>The Set isn't being executed by the ExecIf.  However the ${} substitution containing<br>the SHELL is evaluated before anything else is examined.  This isn't a bug but the<br></div><div>order of how things are evaluated.  You will have to do what you want another way:<br><br></div><div>same = n,GotoIf($["${CALLERID(num)}" = ""]?skip)<br></div><div>same = n,Set(var29=${SHELL(...)})<br></div><div>same = n(skip),NoOp(${var29})<br></div><div><br></div><div>Richard<br></div></div><br></div></div>