Summary: | ASTERISK-25652: func_curl: Add the ability to CURL files down to a specified location | ||
Reporter: | Matt Jordan (mjordan) | Labels: | |
Date Opened: | 2015-12-31 19:53:58.000-0600 | Date Closed: | 2016-09-23 14:45:10 |
Priority: | Major | Regression? | |
Status: | Closed/Complete | Components: | Functions/func_curl |
Versions: | SVN | Frequency of Occurrence | |
Related Issues: | |||
Environment: | Attachments: | ||
Description: | Currently, the {{CURL}} function provides the ability to CURL an HTTP location and return the result in a dialplan variable. While that's sometimes useful, another use case would be to CURL a file down to some location on the file system, then play that file back. In particular, that would obviously be useful if that file were a media file.
The patch referenced on this issue does that by adding the ability to specify a 'write' for the {{CURL}} function that specifies the file to store the result at: {code} same => n,Set(CURL(http://1.1.1.1/foo.wav)=/tmp/foo.wav) {code} Since this could potentially be dangerous, this functionality can only be accessed through APIs if {{live_dangerously}} is True in {{asterisk.conf}}. | ||
Comments: | By: Aaron An (aaron) 2016-01-07 21:52:41.647-0600 It is a good idea. I hava already implemented this but not your solution. I create a new FUNCTION CURL_FILE, before function call I need set channel variable CURL_FILE_PATH like this. {code} same => n,Set(CURL_FILE_PATH=/tmp/foo.wav) same => n,Set(res=${CURL_FILE(http://1.1.1.1/foo.wav)}) {code} I this your solution is better, when you commit it I will test your code. |