res_http_media_cache: Cleanup audio format lookup in HTTP requests

Asterisk first looks at the end of the URL to determine the file
extension of the returned audio, which in many cases will not work
because the URL may end with a query string or a URL fragment. If that
fails, Asterisk then looks at the Content-Type header and then finally
parses the URL to get the extension.

The order has been changed such that we look at the Content-Type
header first, followed by looking for the extension of the parsed
URL. We no longer look at the end of the URL, which was error prone.

ASTERISK-29527 #close

Change-Id: I1e3f83b339ef2b80661704717c23568536511032
This commit is contained in:
Sean Bright
2021-07-23 12:00:00 -04:00
committed by Friendly Automation
parent d0f189a5c9
commit 6428124b06
2 changed files with 13 additions and 14 deletions

View File

@@ -0,0 +1,9 @@
Subject: res_http_media_cache
When fetching a file for playback from a URL, Asterisk will now first
use the value of the Content-Type header in the HTTP response to
determine the format of the audio data, and only if it is unable to do
that will it attempt to parse the URL and extract the extension from
the path portion. Previously Asterisk would first look at the end of
the URL, which may have included query string parameters or a URL
fragment, which was error prone.