mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Check to be sure # of samples is > 0...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -88,6 +88,10 @@ static int measurenoise(struct ast_channel *chan, int ms, char *who)
|
|||||||
}
|
}
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
return res;
|
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);
|
ast_log(LOG_DEBUG, "%s: Noise: %d, samples: %d, avg: %d\n", who, noise, samples, noise / samples);
|
||||||
return (noise / samples);
|
return (noise / samples);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user