<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19572">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">channel.c: Preserve tone playback on masquerades.<br><br>Currently, masquerades can result in inconsistent<br>channel state, notably when a tone is playing on<br>a channel that gets masqueraded.<br><br>This fixes this by copying over the generator fd<br>if there's a generator active so that tone playback<br>continues as expected after the masquerade.<br><br>ASTERISK-30320 #close<br><br>Change-Id: I4753d465bd4d5bb7fe205918e0f22b95a5e869e1<br>---<br>M main/channel.c<br>1 file changed, 25 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/72/19572/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/channel.c b/main/channel.c</span><br><span>index 97ba0f8..f593ce8 100644</span><br><span>--- a/main/channel.c</span><br><span>+++ b/main/channel.c</span><br><span>@@ -7150,8 +7150,13 @@</span><br><span> </span><br><span> /* Copy all file descriptors present on clonechan to original, skipping generator */</span><br><span> for (x = 0; x < ast_channel_fd_count(clonechan); x++) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (x != AST_GENERATOR_FD)</span><br><span style="color: hsl(120, 100%, 40%);">+ /* However, if the original channel had a generator and the new one doesn't,</span><br><span style="color: hsl(120, 100%, 40%);">+ * then it makes sense to move the generator over.</span><br><span style="color: hsl(120, 100%, 40%);">+ * This way tone playback is preserved.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (x != AST_GENERATOR_FD || (generator_fd == -1 && ast_channel_fd(clonechan, x) > -1)) {</span><br><span> ast_channel_set_fd(original, x, ast_channel_fd(clonechan, x));</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> </span><br><span> ast_app_group_update(clonechan, original);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19572">change 19572</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/+/19572"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I4753d465bd4d5bb7fe205918e0f22b95a5e869e1 </div>
<div style="display:none"> Gerrit-Change-Number: 19572 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>