[asterisk-bugs] [JIRA] (ASTERISK-28735) Realtime MoH Unknown format '' -- defaulting to SLIN
Ross Beer (JIRA)
noreply at issues.asterisk.org
Tue Feb 11 04:50:25 CST 2020
[ https://issues.asterisk.org/jira/browse/ASTERISK-28735?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ross Beer updated ASTERISK-28735:
---------------------------------
Description:
A recent change to the res_odbc.c has caused res_musiconhold.c to show the following message when using a realtime database:
{code}
res_musiconhold.c:1126 moh_parse_options: Unknown format '' -- defaulting to SLIN
{code}
When using the 'file' playback method, you do not specify a 'format' and therefore the option is passed '' as the variable.
This has two side effects, firstly the above message is displayed in the CLI/Logs. Secondly, SLIN format is used where transcoding may be required depending on the channels native format.
To resolve this we need to add an additional check to the 'format' if statement:
{code}
} else if (!strcasecmp(var->name, "format") && !var->value) {
ao2_cleanup(mohclass->format);
mohclass->format = ast_format_cache_get(var->value);
if (!mohclass->format) {
ast_log(LOG_WARNING, "Unknown format '%s' -- defaulting to SLIN\n", var->value);
mohclass->format = ao2_bump(ast_format_slin);
}
{code}
was:
A recent change to the res_odbc.c has caused res_musiconhold.c to show the following message when using a realtime database:
{code}
res_musiconhold.c:1126 moh_parse_options: Unknown format '' -- defaulting to SLIN
{code}
When using the 'file' playback method, you do not specify a 'format' and therefore the option is passed '' as the variable.
This has two side effects, firstly the above message is displayed in the CLI/Logs. Secondly, SLIN format is used where transcoding may be required depending on the channels native format.
To resolve this we need to add an additional check to the 'format' if statement:
{code}
} else if (!strcasecmp(var->name, "format")) {
ao2_cleanup(mohclass->format);
mohclass->format = ast_format_cache_get(var->value);
if (!mohclass->format) {
ast_log(LOG_WARNING, "Unknown format '%s' -- defaulting to SLIN\n", var->value);
mohclass->format = ao2_bump(ast_format_slin);
}
{code}
> Realtime MoH Unknown format '' -- defaulting to SLIN
> ----------------------------------------------------
>
> Key: ASTERISK-28735
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-28735
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Resources/res_musiconhold
> Affects Versions: GIT, 13.31.0, 16.8.0, 17.2.0
> Environment: CentOS 7
> Reporter: Ross Beer
>
> A recent change to the res_odbc.c has caused res_musiconhold.c to show the following message when using a realtime database:
> {code}
> res_musiconhold.c:1126 moh_parse_options: Unknown format '' -- defaulting to SLIN
> {code}
> When using the 'file' playback method, you do not specify a 'format' and therefore the option is passed '' as the variable.
> This has two side effects, firstly the above message is displayed in the CLI/Logs. Secondly, SLIN format is used where transcoding may be required depending on the channels native format.
> To resolve this we need to add an additional check to the 'format' if statement:
> {code}
> } else if (!strcasecmp(var->name, "format") && !var->value) {
> ao2_cleanup(mohclass->format);
> mohclass->format = ast_format_cache_get(var->value);
> if (!mohclass->format) {
> ast_log(LOG_WARNING, "Unknown format '%s' -- defaulting to SLIN\n", var->value);
> mohclass->format = ao2_bump(ast_format_slin);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list