Asterisk cmd Curl

Synopsis:

Load an external URL

Description:

Requests an URL. Mainly used for signalling external applications of an event.
Returns 0 or -1 on fatal error.
Argument specified treated as POST data.
Also sets CURL variable with the resulting page.

Installation Requirements:

Local Curl Installation required to compile CURL Support into Asterisk!
Download here: curl.haxx.se
or search for an RPM for your system: rpm-find.net

Return codes:

0 or -1

Variables:

Sets Curl channel variable (CURL) upon completion of retrieval.

Use:

To be used in dialplan as Curl(URL[|postdata])

Example (POST-Method):

exten => _X.,2,curl(http://www.somehost.com/may_be_a_dir/file_to_call.php,postdata_var1=1&postdata_var2=something)
exten => _X.,3,Wait(5)
exten => _X.,4,NoOp(CURL-RESPONSE: ${CURL})

Example (GET-Method):

exten => _X.,2,curl(http://www.somehost.com/may_be_a_dir/file_to_call.php?postdata_var1=1&postdata_var2=something)
exten => _X.,3,Wait(5)
exten => _X.,4,NoOp(CURL-RESPONSE: ${CURL})

Note: Only in CVS HEAD as of 01/12/2005


Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ | CLI

Synopsis:

Load an external URL

Description:

Requests an URL. Mainly used for signalling external applications of an event.
Returns 0 or -1 on fatal error.
Argument specified treated as POST data.
Also sets CURL variable with the resulting page.

Installation Requirements:

Local Curl Installation required to compile CURL Support into Asterisk!
Download here: curl.haxx.se
or search for an RPM for your system: rpm-find.net

Return codes:

0 or -1

Variables:

Sets Curl channel variable (CURL) upon completion of retrieval.

Use:

To be used in dialplan as Curl(URL[|postdata])

Example (POST-Method):

exten => _X.,2,curl(http://www.somehost.com/may_be_a_dir/file_to_call.php,postdata_var1=1&postdata_var2=something)
exten => _X.,3,Wait(5)
exten => _X.,4,NoOp(CURL-RESPONSE: ${CURL})

Example (GET-Method):

exten => _X.,2,curl(http://www.somehost.com/may_be_a_dir/file_to_call.php?postdata_var1=1&postdata_var2=something)
exten => _X.,3,Wait(5)
exten => _X.,4,NoOp(CURL-RESPONSE: ${CURL})

Note: Only in CVS HEAD as of 01/12/2005


Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ | CLI

Created by: compsci, Last modification: Fri 12 of Oct, 2007 (06:10 UTC) by chandave
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+