Skip to content

Asterisk Example

Lorenzo Mangani edited this page May 13, 2017 · 1 revision

Asterisk CURL

Check if an IP/Destination are blocked using CURL

Modules

(none)

exten => _X.,1,Set(CURL_RESULT=${CURL(blacklist.xx.com:3001/api/get/${SIPCHANINFO(peerip)})})
same => n,Set(result=${JSONELEMENT(CURL_RESULT,blocked)})
same => n,GotoIf($["${result}" = "1"]?block:process)
same => n(block),Hangup
same => n(process),Answer
same => n,Hangup

Clone this wiki locally