login | register
Tue 02 of Dec, 2008 [03:24 UTC]

voip-info.org

Discuss [3] History

Asterisk cmd Curl

Created by: compsci,Last modification on Fri 12 of Oct, 2007 [06:10 UTC] by chandave

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


Comments

Comments Filter
222

333CURL-Timeout

by tc0nn, Thursday 08 of December, 2005 [04:11:05 UTC]
Eww.. That was ugly.
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

222

333CURL-Timeout

by cyberskater, Monday 25 of July, 2005 [15:28:02 UTC]
I'm not sure, but have you tried to do something like this?
curl(TARGET,POSTDATA,TIMEOUT)
222

333Timeout for curl?

by tc0nn, Monday 25 of July, 2005 [15:12:03 UTC]
If DNS fails, and calls depend on DNS (through a CURL command), calls are delayed until DNS requests times out. Is there a way to set a timeout for curl executions?