aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
authorbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-05 20:44:53 +0000
committerbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-05 20:44:53 +0000
commit2d88bea805bc1241db31feeeb4656b125733fd0d (patch)
tree5ab500776cebc76b0b3223d700e18e3ae8ba418a /app.c
parentb2ce10d4026d4444b8a5c78289c64709c3823476 (diff)
Voicemail fixes along with an API change approved by russellb to fix the bug(s). (jcollie and supczinskib) #7064
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@25014 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;