aboutsummaryrefslogtreecommitdiffstats
path: root/main/say.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-30 20:17:08 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-30 20:17:08 +0000
commit1b46005ab3e28acc2f38463545facab752e9eca6 (patch)
tree90feaac6b71f3620a4589706a9d8ed24cce6d3f5 /main/say.c
parent4a85704c09d94a57b5b0949952865911ca232a1f (diff)
Applications like SayAlpha() should not hang up the channel if you
request an "unknown" character such as a comma. Instead, skip the character and move on. Issue 10083, initial patch by jsmith, modified by me. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@77795 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/say.c')
-rw-r--r--main/say.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/main/say.c b/main/say.c
index d6106c035..7ab1931ed 100644
--- a/main/say.c
+++ b/main/say.c
@@ -124,14 +124,16 @@ static int say_character_str_full(struct ast_channel *chan, const char *str, con
fnbuf[8] = ltr;
fn = fnbuf;
}
- res = ast_streamfile(chan, fn, lang);
- if (!res) {
- if ((audiofd > -1) && (ctrlfd > -1))
- res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
- else
- res = ast_waitstream(chan, ints);
+ if (fn && ast_fileexists(fn, NULL, NULL) > 0) {
+ res = ast_streamfile(chan, fn, lang);
+ if (!res) {
+ if ((audiofd > -1) && (ctrlfd > -1))
+ res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
+ else
+ res = ast_waitstream(chan, ints);
+ }
+ ast_stopstream(chan);
}
- ast_stopstream(chan);
num++;
}
@@ -202,14 +204,16 @@ static int say_phonetic_str_full(struct ast_channel *chan, const char *str, cons
fnbuf[9] = ltr;
fn = fnbuf;
}
- res = ast_streamfile(chan, fn, lang);
- if (!res) {
- if ((audiofd > -1) && (ctrlfd > -1))
- res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
- else
- res = ast_waitstream(chan, ints);
+ if (fn && ast_fileexists(fn, NULL, NULL) > 0) {
+ res = ast_streamfile(chan, fn, lang);
+ if (!res) {
+ if ((audiofd > -1) && (ctrlfd > -1))
+ res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
+ else
+ res = ast_waitstream(chan, ints);
+ }
+ ast_stopstream(chan);
}
- ast_stopstream(chan);
num++;
}
@@ -250,7 +254,7 @@ static int say_digit_str_full(struct ast_channel *chan, const char *str, const c
fn = fnbuf;
break;
}
- if (fn) {
+ if (fn && ast_fileexists(fn, NULL, NULL) > 0) {
res = ast_streamfile(chan, fn, lang);
if (!res) {
if ((audiofd > -1) && (ctrlfd > -1))