[Home]

Summary:ASTERISK-28735: Realtime MoH Unknown format '' -- defaulting to SLIN
Reporter:Ross Beer (rossbeer)Labels:patch
Date Opened:2020-02-11 04:24:35.000-0600Date Closed:2020-02-13 19:02:02.000-0600
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Resources/res_musiconhold
Versions:13.31.0 GIT 16.8.0 17.2.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 7Attachments:( 0) ASTERISK-28735.patch
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}
Comments:By: Asterisk Team (asteriskteam) 2020-02-11 04:24:37.955-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Ross Beer (rossbeer) 2020-02-11 05:13:25.828-0600

Patch for Asterisk 16

By: Sean Bright (seanbright) 2020-02-11 07:43:54.373-0600

bq. Secondly, SLIN format is used where transcoding may be required depending on the channels native format.

When an {{mohclass}} is first created, we set the format to signed linear by default, so setting it to signed linear again is effectively a NOP.

By: Friendly Automation (friendly-automation) 2020-02-13 19:02:04.237-0600

Change 13740 merged by Joshua Colp:
res_musiconhold: Avoid spurious warning when 'format' is the empty string

[https://gerrit.asterisk.org/c/asterisk/+/13740|https://gerrit.asterisk.org/c/asterisk/+/13740]

By: Friendly Automation (friendly-automation) 2020-02-13 19:02:19.392-0600

Change 13787 merged by Joshua Colp:
res_musiconhold: Avoid spurious warning when 'format' is the empty string

[https://gerrit.asterisk.org/c/asterisk/+/13787|https://gerrit.asterisk.org/c/asterisk/+/13787]

By: Friendly Automation (friendly-automation) 2020-02-13 19:02:32.962-0600

Change 13788 merged by Joshua Colp:
res_musiconhold: Avoid spurious warning when 'format' is the empty string

[https://gerrit.asterisk.org/c/asterisk/+/13788|https://gerrit.asterisk.org/c/asterisk/+/13788]

By: Friendly Automation (friendly-automation) 2020-02-13 19:02:45.910-0600

Change 13801 merged by Joshua Colp:
res_musiconhold: Avoid spurious warning when 'format' is the empty string

[https://gerrit.asterisk.org/c/asterisk/+/13801|https://gerrit.asterisk.org/c/asterisk/+/13801]