Asterisk cmd Curl
Synopsis:
Load an external URLDescription:
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 -1Variables:
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

Comments
333CURL-Timeout
Tried:
exten => s,3,curl('http://jfjkwhfkj/ok?ok=1',,5)
exten => s,3,curl('http://jfjkwhfkj/ok','ok=1',5)
exten => s,3,curl('http://jfjkwhfkj/ok?ok=1',,-m 5)
exten => s,3,curl('http://jfjkwhfkj/ok?ok=1',,'-m 5')
exten => s,3,curl('http://jfjkwhfkj/ok?ok=1',,TIMEOUT=5)
the last one convinced me to stop mucking with it...
Dec 7 22:07:29 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/4 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:29 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/5 already in use on span 1. Hanging up owner.
— Registered SIP '142013' at 10.0.1.43 port 5061 expires 300
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:30 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/4 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:31 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/5 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:33 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/4 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:33 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/5 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:35 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/4 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:35 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/5 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:38 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/4 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:38 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/5 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:40 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/4 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:40 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/4 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:43 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/4 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:43 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/5 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:44 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/4 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:45 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/5 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
Dec 7 22:07:47 WARNING3440: chan_zap.c:8077 pri_dchannel: Ring requested on channel 0/4 already in use on span 1. Hanging up owner.
Don't know what to do if second ROSE component is of type 0x6
333CURL-Timeout
curl(TARGET,POSTDATA,TIMEOUT)
333Timeout for curl?