variable, AVAILCAUSECODE, instead of overwriting the device state in AVAILSTATUS.
* Added 'd' option to app_followme. This option disables the "Please hold"
announcement.
+ * Added 'y' option to app_record. This option enables a mode where any DTMF digit
+ received will terminate recording.
Dialplan Functions
------------------
</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>
OPTION_IGNORE_TERMINATE = (1 << 5),
OPTION_KEEP = (1 << 6),
FLAG_HAS_PERCENT = (1 << 7),
+ OPTION_ANY_TERMINATE = (1 << 8),
};
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),
});
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;