summaryrefslogtreecommitdiff
path: root/apps/app_waitforsilence.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2009-02-11 22:41:01 +0000
committerMark Michelson <mmichelson@digium.com>2009-02-11 22:41:01 +0000
commit47ebea6a8dfa92475ad531e83b9c3d3fbad0e9c1 (patch)
tree0fe1e84cdd6feb3913b86d54e744d79072c635f6 /apps/app_waitforsilence.c
parentff0b908777ea2d79379e800fee20132b4579709f (diff)
Fix 'd' option for app_dial and add new option to Answer application
The 'd' option would not work for channel types which use RTP to transport DTMF digits. The only way to allow for this to work was to answer the channel if we saw that this option was enabled. I realized that this may cause issues with CDRs, specifically with giving false dispositions and answer times. I therefore modified ast_answer to take another parameter which would tell if the CDR should be marked answered. I also extended this to the Answer application so that the channel may be answered but not CDRified if desired. I also modified app_dictate and app_waitforsilence to only answer the channel if it is not already up, to help not allow for faulty CDR answer times. All of these changes are going into Asterisk trunk. For 1.6.0 and 1.6.1, however, all the changes except for the change to the Answer application will go in since we do not introduce new features into stable branches (closes issue #14164) Reported by: DennisD Patches: 14164.patch uploaded by putnopvut (license 60) Tested by: putnopvut Review: http://reviewboard.digium.com/r/145 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_waitforsilence.c')
-rw-r--r--apps/app_waitforsilence.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_waitforsilence.c b/apps/app_waitforsilence.c
index 1aa777575..f68b70ad3 100644
--- a/apps/app_waitforsilence.c
+++ b/apps/app_waitforsilence.c
@@ -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) &&