mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Merge "app_amd: Fix infinite loop on silent calls" into 16
This commit is contained in:
@@ -280,7 +280,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data)
|
||||
int ms = 0;
|
||||
|
||||
/* Figure out how long we waited */
|
||||
if (res > 0) {
|
||||
if (res >= 0) {
|
||||
ms = 2 * maxWaitTimeForFrame - res;
|
||||
}
|
||||
|
||||
@@ -410,6 +410,14 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data)
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
iTotalTime += ms;
|
||||
if (iTotalTime >= totalAnalysisTime) {
|
||||
ast_frfree(f);
|
||||
strcpy(amdStatus , "NOTSURE");
|
||||
sprintf(amdCause , "TOOLONG-%d", iTotalTime);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ast_frfree(f);
|
||||
}
|
||||
|
Reference in New Issue
Block a user