I've created a patch to override the value of MIN_TIME in the vmd
modules using a channel variable. In this way, it can be configured on a
call by call basis. The channel variable is name "vmd_min_time". I
didn't add the other detection parameters, but doing so would be
straight forward. So, in our app, we can catch T-Mobile and the other
problematic cell carriers beeps.
I did this because in our app, we would rather have false positives than
miss the start of recording on a voice mail system. This way, anyone
using the VMD module can configure the vmd module to be as touchy or
hard to trigger as they would like.
I not sure how to implement it (at least in the vmd module code), but a
way to make mod_vmd more robust to false positives, especially with
short beeps would be to have it look for short silence immediately
proceeding and/or following the beep. I've noticed that it tends to
trigger on noise if there is tone in the noise, if for example I extend
a syllable in a word or I have music on in the background.
However on a voice mail system there will likely be a short near silence
before the tone and an indefinite silence after it. In fact, background
noise should be non-existent, except for line noise which should be
Gaussian and not look like a structured tone. Looking for a beep + near
silence after it for some period should eliminate many false positive
where tones are embedded in other sounds (e.g. music or someone holding
a vowel for longer than normal).
Andrew
Index: src/mod/applications/mod_vmd/mod_vmd.c
===================================================================
--- src/mod/applications/mod_vmd/mod_vmd.c (revision 15668)
+++ src/mod/applications/mod_vmd/mod_vmd.c (working copy)
@@ -162,6 +162,8 @@
/*! A count of how long a distinct beep was detected
* by the discreet energy separation algorithm. */
switch_size_t timestamp;
+ /*! The MIN_TIME to use for this call */
+ int minTime;
} vmd_session_info_t;
static switch_bool_t process_data(vmd_session_info_t * vmd_info,
switch_frame_t * frame);
@@ -312,7 +314,7 @@
if (c < (POINTS - MAX_CHIRP)) {
vmd_info->state = BEEP_NOT_DETECTED;
- if (vmd_info->timestamp < MIN_TIME) {
+ if (vmd_info->timestamp < vmd_info->minTime) {
break;
}
@@ -541,6 +543,7 @@
switch_channel_t *channel;
vmd_session_info_t *vmd_info;
int i;
+ const char *minTimeString;
if (session == NULL)
return;
@@ -588,6 +591,14 @@
switch_channel_set_private(channel, "_vmd_", bug);
+ minTimeString = switch_channel_get_variable(channel,
"vmd_min_time");
+ if (minTimeString != 0) {
+ sscanf(minTimeString,"%d",&(vmd_info->minTime));
+ } else {
+ vmd_info->minTime = MIN_TIME;
+ }
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "MIN_TIME for
call: %d\n",vmd_info->minTime);
}
/*! \brief Called when the module shuts down
_______________________________________________
FreeSWITCH-users mailing list
[email protected]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org