[Asterisk-code-review] app_senddtmf: Add receive mode to AMI Action PlayDTMF (asterisk[13])
George Joseph
asteriskteam at digium.com
Thu Nov 21 09:20:23 CST 2019
George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13242 )
Change subject: app_senddtmf: Add receive mode to AMI Action PlayDTMF
......................................................................
app_senddtmf: Add receive mode to AMI Action PlayDTMF
ASTERISK-28614
Change-Id: I183501297ae1dc294ae56b34acac9b0343eb2664
---
M apps/app_senddtmf.c
1 file changed, 12 insertions(+), 1 deletion(-)
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
diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c
index 5dde8dc..d873757 100644
--- a/apps/app_senddtmf.c
+++ b/apps/app_senddtmf.c
@@ -82,6 +82,9 @@
<parameter name="Duration" required="false">
<para>The duration, in milliseconds, of the digit to be played.</para>
</parameter>
+ <parameter name="Receive" required="false">
+ <para>Emulate receiving DTMF on this channel instead of sending it out.</para>
+ </parameter>
</syntax>
<description>
<para>Plays a dtmf digit on the specified channel.</para>
@@ -149,6 +152,7 @@
const char *channel = astman_get_header(m, "Channel");
const char *digit = astman_get_header(m, "Digit");
const char *duration = astman_get_header(m, "Duration");
+ const char *receive_s = astman_get_header(m, "Receive");
struct ast_channel *chan;
unsigned int duration_ms = 0;
@@ -169,7 +173,14 @@
return 0;
}
- ast_senddigit_external(chan, *digit, duration_ms);
+ if (ast_true(receive_s)) {
+ struct ast_frame f = { AST_FRAME_DTMF, };
+ f.len = duration_ms;
+ f.subclass.integer = *digit;
+ ast_queue_frame(chan, &f);
+ } else {
+ ast_senddigit_external(chan, *digit, duration_ms);
+ }
chan = ast_channel_unref(chan);
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13242
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I183501297ae1dc294ae56b34acac9b0343eb2664
Gerrit-Change-Number: 13242
Gerrit-PatchSet: 1
Gerrit-Owner: lvl <digium at lvlconsultancy.nl>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191121/133e6619/attachment.html>
More information about the asterisk-code-review
mailing list