summaryrefslogtreecommitdiff
path: root/formats
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 /formats
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 'formats')
-rw-r--r--formats/format_pcm.c1
-rw-r--r--formats/format_vox.c1
-rw-r--r--formats/format_wav.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/formats/format_pcm.c b/formats/format_pcm.c
index 4e846d7cf..674c8b59a 100644
--- a/formats/format_pcm.c
+++ b/formats/format_pcm.c
@@ -507,6 +507,7 @@ static struct ast_format_def alaw_f = {
static struct ast_format_def pcm_f = {
.name = "pcm",
.exts = "pcm|ulaw|ul|mu|ulw",
+ .mime_types = "audio/basic",
.write = pcm_write,
.seek = pcm_seek,
.trunc = pcm_trunc,
diff --git a/formats/format_vox.c b/formats/format_vox.c
index b63e225be..023c40967 100644
--- a/formats/format_vox.c
+++ b/formats/format_vox.c
@@ -128,6 +128,7 @@ static off_t vox_tell(struct ast_filestream *fs)
static struct ast_format_def vox_f = {
.name = "vox",
.exts = "vox",
+ .mime_types = "audio/x-vox",
.write = vox_write,
.seek = vox_seek,
.trunc = vox_trunc,
diff --git a/formats/format_wav.c b/formats/format_wav.c
index 81a686e36..ec7e3d379 100644
--- a/formats/format_wav.c
+++ b/formats/format_wav.c
@@ -532,6 +532,7 @@ static struct ast_format_def wav16_f = {
static struct ast_format_def wav_f = {
.name = "wav",
.exts = "wav",
+ .mime_types = "audio/wav|audio/x-wav",
.open = wav_open,
.rewrite = wav_rewrite,
.write = wav_write,