Retrieves the contents of a URL
Description
CURL(url[|post-data])
url – URL to retrieve
post-data – Optional data to send as a POST (GET is default action)
Return value
Returns the resulting string/page.
Configuration
Make sure curl is on your system (on “Ubuntu 8.04 server” users can run apt-get install libcurl4-dev)
Then in the asterisk sources re-run the ./configure script and check if it detects curl.
Run make menuselect and look under the Dialplan Functions for the func_curl entry, making sure there are no XXX’s there before compiling and installing asterisk.
Example
exten => s,1,Set(foo=${CURL(https://somewhere.com/somepage.html?x=5&y=4)})
See also
- Asterisk func curlopt – Set options for use with the CURL() function as a channel variables
- Asterisk func shell – Execute a shell command and return the result
- Asterisk cmd ReadFile – Read contents of a file into a dialplan variable
- Asterisk variables
- Asterisk functions