aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapps/app_test.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/app_test.c b/apps/app_test.c
index 90af93c77..3743b6771 100755
--- a/apps/app_test.c
+++ b/apps/app_test.c
@@ -88,6 +88,10 @@ static int measurenoise(struct ast_channel *chan, int ms, char *who)
}
if (res < 0)
return res;
+ if (!samples) {
+ ast_log(LOG_NOTICE, "No samples were received from the other side!\n");
+ return -1;
+ }
ast_log(LOG_DEBUG, "%s: Noise: %d, samples: %d, avg: %d\n", who, noise, samples, noise / samples);
return (noise / samples);
}