From: Boris P. Korzun Date: Sat, 23 Jan 2021 13:15:44 +0000 (+0300) Subject: res_musiconhold: Add support of various URL-schemes by MoH. X-Git-Tag: 19.0.0-rc1~231 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92f5cf7f2d5b0b3c0cc76bb14fa9d1d2ebb57e44;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 8ac3b927cf..736ddc68ab 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -1118,7 +1118,7 @@ static void moh_parse_options(struct ast_variable *var, struct mohclass *mohclas } 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 @@ static void moh_parse_options(struct ast_variable *var, struct mohclass *mohclas 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));