<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14432">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, approved
  Friendly Automation: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_musiconhold: Added check for dot character in path of playlist entries to avoid warnings<br><br>A warning was triggered that there may be a problem regarding file<br>extension (which is correct and should not be set anyway). The warning<br>also appeared if there was dot within the path itself.<br><br>E.g.<br>[sales-queue-hold]<br>mode=playlist<br>entry=/var/www/domain.tld/moh/funky_music<br><br>The music played correctly but you get a warning message.<br><br>Now there will be a check if the position of a potential dot character<br>is after the last position of a slash character. This dot charachter<br>will be treated as a extension naming. Dots within the path then ignored.<br><br>ASTERISK-28892<br>Reported-By: Nicholas John Koch<br><br>Change-Id: I2ec35a613413affbf5fcc01c8c181eba24865b9e<br>---<br>M res/res_musiconhold.c<br>1 file changed, 8 insertions(+), 3 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 dd9b8a5..01a14b9 100644</span><br><span>--- a/res/res_musiconhold.c</span><br><span>+++ b/res/res_musiconhold.c</span><br><span>@@ -1087,9 +1087,14 @@</span><br><span>                                if (!dup) {</span><br><span>                                  continue;</span><br><span>                            }</span><br><span style="color: hsl(0, 100%, 40%);">-                               if (ast_begins_with(dup, "/") && strrchr(dup, '.')) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                 ast_log(LOG_WARNING, "The playlist entry '%s' may include an extension, which could prevent it from playing.\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                                              dup);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+                               if (ast_begins_with(dup, "/")) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                    char *last_pos_dot = strrchr(dup, '.');</span><br><span style="color: hsl(120, 100%, 40%);">+                                       char *last_pos_slash = strrchr(dup, '/');</span><br><span style="color: hsl(120, 100%, 40%);">+                                     if (last_pos_dot && last_pos_dot > last_pos_slash) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                               ast_log(LOG_WARNING, "The playlist entry '%s' may include an extension, which could prevent it from playing.\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                                                    dup);</span><br><span style="color: hsl(120, 100%, 40%);">+                                 }</span><br><span>                            }</span><br><span>                            AST_VECTOR_APPEND(&mohclass->files, dup);</span><br><span>                     } else {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14432">change 14432</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/+/14432"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: I2ec35a613413affbf5fcc01c8c181eba24865b9e </div>
<div style="display:none"> Gerrit-Change-Number: 14432 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Nicholas John Koch <koch@njk-it.de> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </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-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>