aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-05 21:07:01 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-05 21:07:01 +0000
commitf5c91609e55f936b081b63da469fce158b791e7a (patch)
treec766d5632d8dd3aab0b07eab73a3e85a960fb67a /app.c
parent70fec405ccca212eb35a9e32cead289f539ddc16 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@25055 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'app.c')
-rw-r--r--app.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/app.c b/app.c
index 8041a8e73..4971f4d77 100644
--- a/app.c
+++ b/app.c
@@ -537,7 +537,7 @@ int ast_play_and_wait(struct ast_channel *chan, const char *fn)
static int global_silence_threshold = 128;
static int global_maxsilence = 0;
-int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path)
+int ast_play_and_record_full(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path, const char *acceptdtmf, const char *canceldtmf)
{
int d;
char *fmts;
@@ -688,19 +688,18 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
/* Write only once */
ast_writestream(others[0], f);
} else if (f->frametype == AST_FRAME_DTMF) {
- if (f->subclass == '#') {
+ if (strchr(acceptdtmf, f->subclass)) {
if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
- res = '#';
+ ast_verbose(VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
+ res = f->subclass;
outmsg = 2;
ast_frfree(f);
break;
}
- if (f->subclass == '0') {
- /* Check for a '0' during message recording also, in case caller wants operator */
+ if (strchr(canceldtmf, f->subclass)) {
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User cancelled by pressing %c\n", f->subclass);
- res = '0';
+ ast_verbose(VERBOSE_PREFIX_3 "User cancelled message by pressing %c\n", f->subclass);
+ res = f->subclass;
outmsg = 0;
ast_frfree(f);
break;
@@ -762,6 +761,14 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
return res;
}
+static char default_acceptdtmf[] = "#";
+static char default_canceldtmf[] = "0";
+
+int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path)
+{
+ return ast_play_and_record_full(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence, path, default_acceptdtmf, default_canceldtmf);
+}
+
int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime, char *fmt, int *duration, int beep, int silencethreshold, int maxsilence)
{
int d = 0;