[asterisk-users] asterisk trunk CURL hangs in the dialplan

Tilghman Lesher tlesher at digium.com
Tue Nov 24 08:17:44 CST 2009


On Monday 23 November 2009 21:30:10 Eric Chamberlain wrote:
> We've encountered a strange issue with the trunk version of asterisk.
>
> Our dialplan makes CURL calls and occasionally CURL stops working.
>
> The dialplan looks something like this:
>
> [macro-curl]
> ; ${ARG1} CURL URL
> ; ${ARG2} CURL POST
>
> exten => s,1,NoOp(CURL)
> ...
> exten =>
> s,n(post),Set(RF_CURL_POST=userID=${RF_DIALER_USERID}&password=${RF_PASSWOR
>D}&${ARG2}) exten => s,n,Set(CURLOPT(httptimeout)=5)
> exten => s,n,Set(CURLOPT(conntimeout)=5)
> exten => s,n,NoOp(CURL(${RF_URL}/${ARG1}?${RF_CURL_POST}))
> exten =>
> s,n,Set(RF_CURL_RESPONSE=${CURL(${RF_URL}/${ARG1},${RF_CURL_POST})})
>
> At this point, CURL either works or it will occasionally hang for a few
> minutes.  tcpdump doesn't show any traffic from the asterisk box to the web
> server.
>
> Something seems to be causing CURL to hang, before it sends out the http
> request and the CURLOPT timeouts have no effect on the behavior.
>
> Once CURL hangs, any additional calls to CURL also hang.
>
> After a few minutes, tcpdump will show the CURL traffic going to the web
> server.
>
> And CURL begins functioning normally for a while.
>
>
> Has anyone else seen this?  Or have any suggestions on how to debug this?

Sounds like your local DNS resolver isn't answering queries promptly.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list