summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorGaurav Khurana <gkhurana@godaddy.com>2018-02-13 10:55:47 -0800
committerSean Bright <sean.bright@gmail.com>2018-04-30 16:30:44 -0400
commit0827d5cc53c2609231c4ef9bc92f321f258c4af2 (patch)
tree0cc7847c1f82ee6da71ea3d34223b55502d26702 /res
parentf633af89c1d69734589dac2cb16f6de46301c9d6 (diff)
Add the ability to read the media file type from HTTP header for playback
How it works today: media_cache tries to parse out the extension of the media file to be played from the URI provided to Asterisk while caching the file. What's expected: Better will be to have Asterisk get extension from other ways too. One of the common ways is to get the type of content from the CONTENT-TYPE header in the HTTP response for fetching the media file using the URI provided. Steps to Reproduce: Provide a URL of the form: http://host/media/1234 to Asterisk for media playback. It fails to play and logs show the following error line: [Sep 15 15:48:05] WARNING [29148] [C-00000092] file.c: File http://host/media/1234 does not exist in any format Scenario this issue is blocking: In the case where the media files are stored in some cloud object store, following can block the media being played via Asterisk: Cloud storage generally needs authenticated access to the storage. The way to do that is by using signed URIs. With the signed URIs there's no way to preserve the name of the file. In most cases Cloud storage returns a key to access the object and preserving file name is also not a thing there ASTERISK-27286 Reporter: Gaurav Khurana Change-Id: I1b14692a49b2c1ac67688f58757184122e92ba89
Diffstat (limited to 'res')
-rw-r--r--res/res_http_media_cache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/res/res_http_media_cache.c b/res/res_http_media_cache.c
index eba7ecc61..bca576372 100644
--- a/res/res_http_media_cache.c
+++ b/res/res_http_media_cache.c
@@ -84,6 +84,7 @@ static size_t curl_header_callback(char *buffer, size_t size, size_t nitems, voi
if (strcasecmp(header, "ETag")
&& strcasecmp(header, "Cache-Control")
&& strcasecmp(header, "Last-Modified")
+ && strcasecmp(header, "Content-Type")
&& strcasecmp(header, "Expires")) {
return realsize;
}