diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2007-01-12 15:01:46 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2007-01-12 15:01:46 +0000 |
commit | 17ea9c930e19d38670fff36f22ef783fd63ab202 (patch) | |
tree | 30eeacf29de117fe01d8c351cc463d6662b40061 /main/pbx.c | |
parent | aa3eea042d8b1f512d9f4ee0405535e45a0434ce (diff) |
make the automatic post-answer delay happen only when the answer is 'automatic' (not done by the Answer() dialplan application)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@50571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/main/pbx.c b/main/pbx.c index 10c9911ad..1f656adea 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -5326,21 +5326,11 @@ static int pbx_builtin_congestion(struct ast_channel *chan, void *data) static int pbx_builtin_answer(struct ast_channel *chan, void *data) { int delay = 0; - int res; - if (chan->_state == AST_STATE_UP) - delay = 0; - else if (!ast_strlen_zero(data)) + if ((chan->_state != AST_STATE_UP) && !ast_strlen_zero(data)) delay = atoi(data); - res = ast_answer(chan); - if (res) - return res; - - if (delay) - res = ast_safe_sleep(chan, delay); - - return res; + return __ast_answer(chan, delay); } AST_APP_OPTIONS(resetcdr_opts, { |