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: https://origsvn.digium.com/svn/asterisk/trunk@232442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
74b388ea4a
commit
a0b1c785c6
2
CHANGES
2
CHANGES
|
@ -103,6 +103,8 @@ Applications
|
||||||
variable, AVAILCAUSECODE, instead of overwriting the device state in AVAILSTATUS.
|
variable, AVAILCAUSECODE, instead of overwriting the device state in AVAILSTATUS.
|
||||||
* Added 'd' option to app_followme. This option disables the "Please hold"
|
* Added 'd' option to app_followme. This option disables the "Please hold"
|
||||||
announcement.
|
announcement.
|
||||||
|
* Added 'y' option to app_record. This option enables a mode where any DTMF digit
|
||||||
|
received will terminate recording.
|
||||||
|
|
||||||
Dialplan Functions
|
Dialplan Functions
|
||||||
------------------
|
------------------
|
||||||
|
|
|
@ -77,7 +77,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||||
</option>
|
</option>
|
||||||
<option name="k">
|
<option name="k">
|
||||||
<para>Keep recording if channel hangs up.</para>
|
<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>
|
</optionlist>
|
||||||
</parameter>
|
</parameter>
|
||||||
</syntax>
|
</syntax>
|
||||||
|
@ -117,6 +120,7 @@ enum {
|
||||||
OPTION_IGNORE_TERMINATE = (1 << 5),
|
OPTION_IGNORE_TERMINATE = (1 << 5),
|
||||||
OPTION_KEEP = (1 << 6),
|
OPTION_KEEP = (1 << 6),
|
||||||
FLAG_HAS_PERCENT = (1 << 7),
|
FLAG_HAS_PERCENT = (1 << 7),
|
||||||
|
OPTION_ANY_TERMINATE = (1 << 8),
|
||||||
};
|
};
|
||||||
|
|
||||||
AST_APP_OPTIONS(app_opts,{
|
AST_APP_OPTIONS(app_opts,{
|
||||||
|
@ -126,6 +130,7 @@ AST_APP_OPTIONS(app_opts,{
|
||||||
AST_APP_OPTION('q', OPTION_QUIET),
|
AST_APP_OPTION('q', OPTION_QUIET),
|
||||||
AST_APP_OPTION('s', OPTION_SKIP),
|
AST_APP_OPTION('s', OPTION_SKIP),
|
||||||
AST_APP_OPTION('t', OPTION_STAR_TERMINATE),
|
AST_APP_OPTION('t', OPTION_STAR_TERMINATE),
|
||||||
|
AST_APP_OPTION('y', OPTION_ANY_TERMINATE),
|
||||||
AST_APP_OPTION('x', OPTION_IGNORE_TERMINATE),
|
AST_APP_OPTION('x', OPTION_IGNORE_TERMINATE),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -372,7 +377,8 @@ static int record_exec(struct ast_channel *chan, const char *data)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if ((f->frametype == AST_FRAME_DTMF) &&
|
} 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);
|
ast_frfree(f);
|
||||||
pbx_builtin_setvar_helper(chan, "RECORD_STATUS", "DTMF");
|
pbx_builtin_setvar_helper(chan, "RECORD_STATUS", "DTMF");
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue