Fix 'd' option for app_dial and add new option to Answer application
[asterisk/asterisk.git] / apps / app_waitforsilence.c
index 1aa7775..f68b70a 100644 (file)
@@ -210,7 +210,9 @@ static int waitfor_exec(struct ast_channel *chan, void *data, int wait_for_silen
        int iterations = 1, i;
        time_t waitstart;
 
-       res = ast_answer(chan); /* Answer the channel */
+       if (chan->_state != AST_STATE_UP) {
+               res = ast_answer(chan); /* Answer the channel */
+       }
 
        if (!data || ( (sscanf(data, "%d,%d,%d", &timereqd, &iterations, &timeout) != 3) &&
                (sscanf(data, "%d,%d", &timereqd, &iterations) != 2) &&