Trubles with CURl

Asterisk 14.7.5, FreePBX 14.0.3.6
Hi there!

I’ve got a problem

Then i insert the lines in the beginig of context “macro-dial”
[macro-dial]
exten => s,1,SET(CURL_RESULT=${CURL(http:/mycrm/rest/userstate)}) – my line
exten => s,n,GotoIf($["${CURL_RESULT}" = “No”]?NOANSWER,1) – my line
exten => s,n,Noop(Blind Transfer: ${BLINDTRANSFER}, Attended Transfer: ${ATTENDEDTRANSFER}, User: ${AMPUSER}, Alert Info: ${ALERT_INFO})
exten => s,n,ExecIf($["${ALERT_INFO}"="" & ${LEN(${AMPUSER})}!=0 & ${LEN(${BLINDTRANSFER})}=0 & ${LEN(${ATTENDEDTRANSFER})}=0]?Set(ALERT_INFO=))
exten => s,n,ExecIf($[${LEN(${BLINDTRANSFER})}!=0]?Set(ALERT_INFO=))

I’m getting serius CPU utilisation and voice distutrion, then total simulanius calls amount 40-50.

I’ve tryed like this
[macro-dial]
exten => s,1,AGI(crm.php,userstate)
exten => s,n,GotoIf($["${CURL_RESULT}" = “No”]?NOANSWER,1)

or like this
[macro-dial]
exten => s,1,System(${AMPBIN}/crm.php “userstate”)
exten => s,n,GotoIf($["${CURL_RESULT}" = “No”]?NOANSWER,1)

And got same result like with CURL function.

But if
[macro-dial]
exten => s,1,System(${AMPBIN}/crm.php “userstate”&)
exten => s,n,GotoIf($["${CURL_RESULT}" = “No”]?NOANSWER,1)

there are no CPU utilisatoin, like a results.

Anyone know why is this happened? Or what i’ve should to chek, and how can i do that?

There is no macro-dial supplied with Asterisk so telling us you have put it at the front of that really doesn’t tell us anything. I was actually surprised that there are still macros of any sort in the samle configuration, as they were deprecated long ago.

AMPUSER is I think part of FreePBX, which is not supported here…

To the best of my knowledge FreePBX does not support any modifications of their standard macros, although I’m not sure why your change would have the effect you describe. It wouldn’t have been surprised if it had been overwritten by FreePBX. It is also possible that parts of FreePBX are assuming absolute prioirity numbers in their fixed dialplan.