[asterisk-commits] oej: branch oej/silence-detection-games-1.8 r411837 - /team/oej/silence-detec...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Apr 7 10:23:53 CDT 2014
Author: oej
Date: Mon Apr 7 10:23:49 2014
New Revision: 411837
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=411837
Log:
Adding debugging
Modified:
team/oej/silence-detection-games-1.8/main/silencedetection.c
Modified: team/oej/silence-detection-games-1.8/main/silencedetection.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/silence-detection-games-1.8/main/silencedetection.c?view=diff&rev=411837&r1=411836&r2=411837
==============================================================================
--- team/oej/silence-detection-games-1.8/main/silencedetection.c (original)
+++ team/oej/silence-detection-games-1.8/main/silencedetection.c Mon Apr 7 10:23:49 2014
@@ -204,7 +204,7 @@
}
/*! \brief Activation of silence detection */
-int ast_sildet_activate(struct ast_channel *chan, int silencelevel, int silenceframes)
+int ast_sildet_activate(struct ast_channel *chan, unsigned int silencelevel, unsigned int silenceframes)
{
struct ast_datastore *datastore = NULL;
struct silence_detection_info *sildet = NULL;
@@ -217,8 +217,10 @@
}
ast_channel_lock(chan);
+ ast_debug(4, "----> Looking for silence detection datastore for %s\n", chan->name);
if (!(datastore = ast_channel_datastore_find(chan, &sildet_datastore, NULL))) {
if (!(datastore = initialize_sildethook(chan))) {
+ ast_debug(4, "----> Failed to initialize hook for silence detection for %s\n", chan->name);
ast_channel_unlock(chan);
return 0;
}
@@ -227,6 +229,17 @@
/* Configure the silence detection */
sildet = datastore->data;
+ if (!sildet) {
+ ast_debug(4, "----> No datastore data for silence detection for %s\n", chan->name);
+ ast_channel_unlock(chan);
+ return 0;
+ }
+ if (!sildet->dsp) {
+ ast_debug(4, "----> No datastore dsp for silence detection for %s\n", chan->name);
+ ast_channel_unlock(chan);
+ return 0;
+ }
+ ast_debug(4, "----> Looking for silence detection datastore for %s\n", chan->name);
sildet->silencelevel = silencelevel;
sildet->silenceframes = silenceframes;
sildet->active = 1;
More information about the asterisk-commits
mailing list