aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_record.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-02 18:35:47 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-02 18:35:47 +0000
commit41e4f7d70781b2cfbc34761292f43074c57e01f3 (patch)
treea3573d98c54a8804d2c0899a1a75d1d8b29adcad /apps/app_record.c
parent989993214b212b205d269dd959f5c9a2f8899e6e (diff)
Add an option to Record which enables a mode where any DTMF digit will terminate recording.
(closes issue #15436) Reported by: Vince Patches: app_record.diff uploaded by Vince (license 823) Tested by: dbrooks git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232442 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_record.c')
-rw-r--r--apps/app_record.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/app_record.c b/apps/app_record.c
index ce4181d6a..14b665d30 100644
--- a/apps/app_record.c
+++ b/apps/app_record.c
@@ -77,7 +77,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
</option>
<option name="k">
<para>Keep recording if channel hangs up.</para>
- </option>
+ </option>
+ <option name="y">
+ <para>Terminate recording if *any* DTMF digit is received.</para>
+ </option>
</optionlist>
</parameter>
</syntax>
@@ -117,6 +120,7 @@ enum {
OPTION_IGNORE_TERMINATE = (1 << 5),
OPTION_KEEP = (1 << 6),
FLAG_HAS_PERCENT = (1 << 7),
+ OPTION_ANY_TERMINATE = (1 << 8),
};
AST_APP_OPTIONS(app_opts,{
@@ -126,6 +130,7 @@ AST_APP_OPTIONS(app_opts,{
AST_APP_OPTION('q', OPTION_QUIET),
AST_APP_OPTION('s', OPTION_SKIP),
AST_APP_OPTION('t', OPTION_STAR_TERMINATE),
+ AST_APP_OPTION('y', OPTION_ANY_TERMINATE),
AST_APP_OPTION('x', OPTION_IGNORE_TERMINATE),
});
@@ -372,7 +377,8 @@ static int record_exec(struct ast_channel *chan, const char *data)
break;
}
} else if ((f->frametype == AST_FRAME_DTMF) &&
- (f->subclass.integer == terminator)) {
+ ((f->subclass.integer == terminator) ||
+ (ast_test_flag(&flags, OPTION_ANY_TERMINATE)))) {
ast_frfree(f);
pbx_builtin_setvar_helper(chan, "RECORD_STATUS", "DTMF");
break;