Merged revisions 68401 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Fri, 8 Jun 2007 00:18:58 +0000 (00:18 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 8 Jun 2007 00:18:58 +0000 (00:18 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r68401 | file | 2007-06-07 20:17:04 -0400 (Thu, 07 Jun 2007) | 10 lines

Merged revisions 68397 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68397 | file | 2007-06-07 20:15:33 -0400 (Thu, 07 Jun 2007) | 2 lines

Don't call ast_waitstream_full when the control file descriptor and audio file descriptor are not set, simply call ast_waitstream! (issue #8530 reported by rickead2000)

........

................

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68405 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/say.c

index fdc142d..340b5fa 100644 (file)
@@ -125,8 +125,12 @@ static int say_character_str_full(struct ast_channel *chan, const char *str, con
                        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 @@ static int say_phonetic_str_full(struct ast_channel *chan, const char *str, cons
                        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++;
        }
@@ -244,8 +252,12 @@ static int say_digit_str_full(struct ast_channel *chan, const char *str, const c
                }
                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++;