Skip to content

Instantly share code, notes, and snippets.

exten => _X.,1,Set(CURL_RESULT=${CURL(http://domain.com/test.json)})
same => n,Set(result=${JSONELEMENT(CURL_RESULT,result/subfield)})
same => n,GotoIf($["${result}" = "1"]?result1:result2)
same => n(result1),Verbose(Result 1)
exten => _X.,1,Set(CURL_RESULT=${CURL(http://domain.com/test.txt)})
exten => _X.,1,Set(CURL_RESULT=${CURL(http://domain.com/test.txt)})
same => n,GotoIf($["${CURL_RESULT}" = "1"]?result1:result2)
same => n(result1),Verbose(Result 1)
same => n,Hangup
same => n(result2),Verbose(Result other)
same => n,Hangup
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04