[Asterisk-code-review] app_mp3: Document and warn about https incompatibility. (asterisk[master])

N A asteriskteam at digium.com
Sat Feb 5 06:43:20 CST 2022


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18002 )


Change subject: app_mp3: Document and warn about https incompatibility.
......................................................................

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
---
M apps/app_mp3.c
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/02/18002/1

diff --git a/apps/app_mp3.c b/apps/app_mp3.c
index 5d2fc88..79484f5 100644
--- a/apps/app_mp3.c
+++ b/apps/app_mp3.c
@@ -66,6 +66,7 @@
 			<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
 			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 @@
 				} 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, "mpg123 does not support https streams. Use http instead.\n");
+						}
 						ast_log(LOG_WARNING, "MP3 stream '%s' is broken or nonexistent\n", data);
 					}
 					res = 0;
@@ -305,4 +309,4 @@
 	return ast_register_application_xml(app, mp3_exec);
 }
 
-AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Silly MP3 Application");
+AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "MP3 Player Application");

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18002
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie3b029be5258c5a701f71ed3b1a7a80d1e03b827
Gerrit-Change-Number: 18002
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220205/9f66ce13/attachment.html>


More information about the asterisk-code-review mailing list