<p>Joshua Colp <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13740">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Joshua Colp: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_musiconhold: Avoid spurious warning when 'format' is the empty string<br><br>The change to res_config_odbc that allowed empty strings to be<br>returned to realtime consumers¹ causes a warning to be emitted when<br>loading MoH classes. So we need to treat an empty 'format' as if it<br>was not specified to avoid the warning.<br><br>ASTERISK-28735 #close<br>Reported by: Ross Beer<br><br>[1] https://gerrit.asterisk.org/c/asterisk/+/13722<br><br>Change-Id: I9a271d721e1a0973e80ebe7d75b46a0d8fa0e5a5<br>---<br>M res/res_musiconhold.c<br>1 file changed, 2 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c</span><br><span>index f029b16..60682fb 100644</span><br><span>--- a/res/res_musiconhold.c</span><br><span>+++ b/res/res_musiconhold.c</span><br><span>@@ -1517,7 +1517,7 @@</span><br><span> ast_set_flag(mohclass, MOH_RANDOMIZE);</span><br><span> else if (!strcasecmp(tmp->name, "sort") && !strcasecmp(tmp->value, "alpha"))</span><br><span> ast_set_flag(mohclass, MOH_SORTALPHA);</span><br><span style="color: hsl(0, 100%, 40%);">- else if (!strcasecmp(tmp->name, "format")) {</span><br><span style="color: hsl(120, 100%, 40%);">+ else if (!strcasecmp(tmp->name, "format") && !ast_strlen_zero(tmp->value)) {</span><br><span> ao2_cleanup(mohclass->format);</span><br><span> mohclass->format = ast_format_cache_get(tmp->value);</span><br><span> if (!mohclass->format) {</span><br><span>@@ -1831,7 +1831,7 @@</span><br><span> ast_set_flag(class, MOH_RANDOMIZE);</span><br><span> } else if (!strcasecmp(var->name, "sort") && !strcasecmp(var->value, "alpha")) {</span><br><span> ast_set_flag(class, MOH_SORTALPHA);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp(var->name, "format")) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp(var->name, "format") && !ast_strlen_zero(var->value)) {</span><br><span> ao2_cleanup(class->format);</span><br><span> class->format = ast_format_cache_get(var->value);</span><br><span> if (!class->format) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13740">change 13740</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/13740"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: I9a271d721e1a0973e80ebe7d75b46a0d8fa0e5a5 </div>
<div style="display:none"> Gerrit-Change-Number: 13740 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>