[Home]

Summary:ASTERISK-10303: moh does not play during calls to func_curl
Reporter:Matthew Nicholson (mnicholson)Labels:
Date Opened:2007-09-14 16:51:26Date Closed:2007-09-19 14:17:47
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Functions/func_curl
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:func_curl does not service the channel during execution which causes music on hold to stop playing during curl execution.  This can be fixed by starting an autoservice on the channel before doing any long running operations.

****** ADDITIONAL INFORMATION ******

Other applications and functions suffer from this same issue.
Comments:By: Matthew Nicholson (mnicholson) 2007-09-14 16:54:33

You can reproduce this with the following dialplan snippet that downloads the SIP RFC.

[curl-test]

exten => s,1,StartMusicOnHold
exten => s,n,Wait(3)
exten => s,n,Noop(${CURL(http://www.ietf.org/rfc/rfc3261.txt)})
exten => s,n,Wait(3)
exten => s,n,StopMusicOnHold

By: Jason Parker (jparker) 2007-09-14 17:50:14

So, I'm looking at this, and I'm pondering...

It looks like if you try to do an ast_autoservice_start more than once, it does nothing.  Once you ast_autoservice_stop, that's it - it's done.

The reason I was pondering this, is nested functions..  Imagine the following scenario...

Set(blah=${CURL(${CURL(http://myurl/that/returns/another/url)})})

Once the first (inner) CURL is finished, it'll remove the autoservice from the channel, and the audio will stop during the second.

By: Jason Parker (jparker) 2007-09-14 17:57:18

Scratch that.  I'm wrong.

By: Russell Bryant (russell) 2007-09-19 14:11:07

You're right.  If there is an operation that must be performed that is going to take any good amount of time which doesn't involve servicing the channel, then the channel needs to be autoserviced.

By: Digium Subversion (svnbot) 2007-09-19 14:15:46

Repository: asterisk
Revision: 83177

------------------------------------------------------------------------
r83177 | russell | 2007-09-19 14:15:41 -0500 (Wed, 19 Sep 2007) | 4 lines

Using curl can take a substantial amount of time, so the channel should be
autoserviced while waiting for it to complete.
(closes issue ASTERISK-10303, reported by mnicholson)

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-09-19 14:17:47

Repository: asterisk
Revision: 83178

------------------------------------------------------------------------
r83178 | russell | 2007-09-19 14:17:45 -0500 (Wed, 19 Sep 2007) | 12 lines

Merged revisions 83177 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r83177 | russell | 2007-09-19 14:34:25 -0500 (Wed, 19 Sep 2007) | 4 lines

Using curl can take a substantial amount of time, so the channel should be
autoserviced while waiting for it to complete.
(closes issue ASTERISK-10303, reported by mnicholson)

........

------------------------------------------------------------------------