]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't call ast_waitstream_full when the control file descriptor and audio file descri...
authorJoshua Colp <jcolp@digium.com>
Fri, 8 Jun 2007 00:15:33 +0000 (00:15 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 8 Jun 2007 00:15:33 +0000 (00:15 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@68397 65c4cc65-6c06-0410-ace0-fbb531ad65f3

say.c

diff --git a/say.c b/say.c
index 459e181c988c695dc9bfc6907e2d7fa884a8dc95..a20e325af200b7076abc8d260231ad0451f018f4 100644 (file)
--- a/say.c
+++ b/say.c
@@ -120,8 +120,12 @@ int ast_say_character_str_full(struct ast_channel *chan, const char *str, const
                        fn = fnbuf;
                }
                res = ast_streamfile(chan, fn, lang);
-               if (!res) 
-                       res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
+               if (!res) {
+                       if ((audiofd  > -1) && (ctrlfd > -1))
+                               res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
+                       else
+                               res = ast_waitstream(chan, ints);
+               }
                ast_stopstream(chan);
                num++;
        }
@@ -199,8 +203,12 @@ int ast_say_phonetic_str_full(struct ast_channel *chan, const char *str, const c
                        fn = fnbuf;
                }
                res = ast_streamfile(chan, fn, lang);
-               if (!res) 
-                       res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
+               if (!res) {
+                       if ((audiofd  > -1) && (ctrlfd > -1))
+                               res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
+                       else
+                               res = ast_waitstream(chan, ints);
+               }
                ast_stopstream(chan);
                num++;
        }
@@ -249,8 +257,12 @@ int ast_say_digit_str_full(struct ast_channel *chan, const char *str, const char
                }
                if (fn) {
                        res = ast_streamfile(chan, fn, lang);
-                       if (!res) 
-                               res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
+                       if (!res) {
+                               if ((audiofd  > -1) && (ctrlfd > -1))
+                                        res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
+                                else
+                                        res = ast_waitstream(chan, ints);
+                       }
                        ast_stopstream(chan);
                }
                num++;