Eric Chamberlain
2009-Nov-24 03:30 UTC
[asterisk-users] asterisk trunk CURL hangs in the dialplan
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_PASSWORD}&${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? -- Eric Chamberlain, Founder RF.com - http://RF.com/
Tilghman Lesher
2009-Nov-24 14:17 UTC
[asterisk-users] asterisk trunk CURL hangs in the dialplan
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