Make sure that the channel is answered before doing SpeechBackground. (issue #josh...
authorJoshua Colp <jcolp@digium.com>
Mon, 15 May 2006 15:30:21 +0000 (15:30 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 15 May 2006 15:30:21 +0000 (15:30 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@27194 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_speech_utils.c

index 8b1194c..94c4866 100644 (file)
@@ -512,6 +512,12 @@ static int speech_background(struct ast_channel *chan, void *data)
                 return -1;
         }
 
+       /* If channel is not already answered, then answer it */
+       if (chan->_state != AST_STATE_UP && ast_answer(chan)) {
+               LOCAL_USER_REMOVE(u);
+               return -1;
+       }
+
         /* Record old read format */
         oldreadformat = chan->readformat;