diff options
author | BJ Weschke <bweschke@btwtech.com> | 2006-04-06 20:37:29 +0000 |
---|---|---|
committer | BJ Weschke <bweschke@btwtech.com> | 2006-04-06 20:37:29 +0000 |
commit | 3b89edc066382988fa28993523ea14e8fbd4a43a (patch) | |
tree | ce6732a8739a0352ef4c980dcd845c23c17288d4 | |
parent | 54832880489bf55b8998e70b3f704306d8b06d54 (diff) |
More code optimizations. Thanks kpfleming!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@18025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | apps/app_amd.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/apps/app_amd.c b/apps/app_amd.c index f44c1af20..8312958d2 100644 --- a/apps/app_amd.c +++ b/apps/app_amd.c @@ -207,19 +207,8 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data) while ((ret = ast_waitfor(chan, totalAnalysisTime))) { - if (ret < 0) { - /* No Frame: Called Party Must Have Dropped */ - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "AMD: HANGUP\n"); - if (option_debug) - ast_log(LOG_DEBUG, "Got hangup\n"); - strcpy(amdStatus , "HANGUP" ); - strcpy(amdCause , "" ); - break; - } - f = ast_read(chan); - if (!f ) { - /* No Frame: Called Party Must Have Dropped */ + if (ret < 0 || !(f = ast_read(chan))) { + /* No Frame OR Error on ast_waitfor : Called Party Must Have Dropped */ if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "AMD: HANGUP\n"); if (option_debug) |