Skip to content

Commit c9ef2b3

Browse files
InterLinked1kharwell
authored andcommitted
app_mp3: Document and warn about HTTPS incompatibility.
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
1 parent 0da7131 commit c9ef2b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/app_mp3.c

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

0 commit comments

Comments
 (0)