<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13242">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_senddtmf: Add receive mode to AMI Action PlayDTMF<br><br>ASTERISK-28614<br><br>Change-Id: I183501297ae1dc294ae56b34acac9b0343eb2664<br>---<br>M apps/app_senddtmf.c<br>1 file changed, 12 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c</span><br><span>index 5dde8dc..d873757 100644</span><br><span>--- a/apps/app_senddtmf.c</span><br><span>+++ b/apps/app_senddtmf.c</span><br><span>@@ -82,6 +82,9 @@</span><br><span> <parameter name="Duration" required="false"></span><br><span> <para>The duration, in milliseconds, of the digit to be played.</para></span><br><span> </parameter></span><br><span style="color: hsl(120, 100%, 40%);">+ <parameter name="Receive" required="false"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Emulate receiving DTMF on this channel instead of sending it out.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </parameter></span><br><span> </syntax></span><br><span> <description></span><br><span> <para>Plays a dtmf digit on the specified channel.</para></span><br><span>@@ -149,6 +152,7 @@</span><br><span> const char *channel = astman_get_header(m, "Channel");</span><br><span> const char *digit = astman_get_header(m, "Digit");</span><br><span> const char *duration = astman_get_header(m, "Duration");</span><br><span style="color: hsl(120, 100%, 40%);">+ const char *receive_s = astman_get_header(m, "Receive");</span><br><span> struct ast_channel *chan;</span><br><span> unsigned int duration_ms = 0;</span><br><span> </span><br><span>@@ -169,7 +173,14 @@</span><br><span> return 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_senddigit_external(chan, *digit, duration_ms);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_true(receive_s)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_frame f = { AST_FRAME_DTMF, };</span><br><span style="color: hsl(120, 100%, 40%);">+ f.len = duration_ms;</span><br><span style="color: hsl(120, 100%, 40%);">+ f.subclass.integer = *digit;</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_queue_frame(chan, &f);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_senddigit_external(chan, *digit, duration_ms);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span> chan = ast_channel_unref(chan);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13242">change 13242</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/+/13242"/><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: I183501297ae1dc294ae56b34acac9b0343eb2664 </div>
<div style="display:none"> Gerrit-Change-Number: 13242 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lvl <digium@lvlconsultancy.nl> </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: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>