]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_mp3: Document and warn about HTTPS incompatibility.
authorNaveen Albert <asterisk@phreaknet.org>
Sat, 5 Feb 2022 12:39:42 +0000 (12:39 +0000)
committerN A <mail@interlinked.x10host.com>
Thu, 17 Feb 2022 17:22:19 +0000 (11:22 -0600)
mpg123 doesn't support HTTPS, but the MP3Player application
doesn't document this or warn the user about this. HTTPS
streams have become more common nowadays and users could
reasonably try to play them without being aware they should
use the HTTP stream instead.

This adds documentation to note this limitation. It also
throws a warning if users try to use the HTTPS stream to
tell them to use the HTTP stream instead.

ASTERISK-29900 #close

Change-Id: Ie3b029be5258c5a701f71ed3b1a7a80d1e03b827

apps/app_mp3.c

index 5d2fc88a3b090f796b8179e06cfb1b9b770baca2..9bc23c0477a1f95fb29f813d0d49eb88f1420947 100644 (file)
@@ -64,8 +64,9 @@
                </syntax>
                <description>
                        <para>Executes mpg123 to play the given location, which typically would be a mp3 filename
-                       or m3u playlist filename or a URL. Please read http://en.wikipedia.org/wiki/M3U
+                       or m3u playlist filename or a URL. Please read https://en.wikipedia.org/wiki/M3U
                        to see what the M3U playlist file format is like.</para>
+                       <para>Note that mpg123 does not support HTTPS, so use HTTP for web streams.</para>
                        <para>User can exit by pressing any key on the dialpad, or by hanging up.</para>
                        <example title="Play an MP3 playlist">
                        exten => 1234,1,MP3Player(/var/lib/asterisk/playlist.m3u)
@@ -251,6 +252,9 @@ static int mp3_exec(struct ast_channel *chan, const char *data)
                                } else {
                                        ast_debug(1, "No more mp3\n");
                                        if (!startedmp3) { /* we couldn't do anything, which means this stream doesn't work */
+                                               if (!strncasecmp(data, "https://", 8)) {
+                                                       ast_log(LOG_WARNING, "%s() does not support HTTPS streams. Use HTTP instead.\n", app);
+                                               }
                                                ast_log(LOG_WARNING, "MP3 stream '%s' is broken or nonexistent\n", data);
                                        }
                                        res = 0;