[Asterisk-code-review] res_musiconhold: Add support of various URL-schemes by MoH. (asterisk[16])

Boris P. Korzun asteriskteam at digium.com
Mon Jan 25 10:49:51 CST 2021


Boris P. Korzun has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15371 )


Change subject: res_musiconhold: Add support of various URL-schemes by MoH.
......................................................................

res_musiconhold: Add support of various URL-schemes by MoH.

Provided a support of variuos URL-schemes for res_musiconhold,
registered by ast_bucket_scheme_register().

ASTERISK-29262 #close

Change-Id: If0ea8697587353dce358a70035d82649fd4632b6
---
M res/res_musiconhold.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/71/15371/1

diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 8ac3b92..736ddc6 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -1118,7 +1118,7 @@
 		} else if (!strcasecmp(var->name, "mode")) {
 			ast_copy_string(mohclass->mode, var->value, sizeof(mohclass->mode));
 		} else if (!strcasecmp(var->name, "entry")) {
-			if (ast_begins_with(var->value, "/") || ast_begins_with(var->value, "http://") || ast_begins_with(var->value, "https://")) {
+			if (ast_begins_with(var->value, "/") || strstr(var->value, "://")) {
 				char *dup;
 
 				if (!playlist_entries) {
@@ -1144,7 +1144,7 @@
 
 				AST_VECTOR_APPEND(playlist_entries, dup);
 			} else {
-				ast_log(LOG_ERROR, "Playlist entries must be an HTTP(S) URL or absolute path, '%s' provided.\n", var->value);
+				ast_log(LOG_ERROR, "Playlist entries must be a URL or an absolute path, '%s' provided.\n", var->value);
 			}
 		} else if (!strcasecmp(var->name, "directory")) {
 			ast_copy_string(mohclass->dir, var->value, sizeof(mohclass->dir));

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: If0ea8697587353dce358a70035d82649fd4632b6
Gerrit-Change-Number: 15371
Gerrit-PatchSet: 1
Gerrit-Owner: Boris P. Korzun <drtr0jan at yandex.ru>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210125/25afbbba/attachment.html>


More information about the asterisk-code-review mailing list