80 Commits

Author SHA1 Message Date
Piotr Gregor
8e189ed233 FS-9542 [avmd]: multithreaded
Now avmd detection is done in detector threads
processing audio frames with different resolution
and/or offsets. Detection decision is based on relative
standard deviation which dynamically adjusts to the signal.
Detection of amplitude, frequency and both simultaneously
is enabled and corresponding setting added to the configuration.
Frequency estimates are filtered with median filter.

This commit also resolves:
FS-9539 - Get estimates with different resolution
FS-9513 - Use adjustable thresholds
FS-9502 - Add detection mode setting
FS-9501 - Enable three modes of detection
FS-9407 - Add check of amplitude for NaN before appending to SMA buffer
FS-9139 - Unit test framework
2016-09-26 10:48:44 +01:00
Piotr Gregor
0247c92cb5 FS-9527 [avmd]: Fix MAP_POPULATE on FreeBSD
Remove unsupported flag.
2016-09-19 22:47:14 +01:00
Piotr Gregor
8f4956725c FS-9519: [avmd] Add unit test
Add perl script for testing of voicemail detection.
2016-09-15 22:55:28 +01:00
Piotr Gregor
194a248522 FS-9509: [avmd] Add perl script subscribing to avmd events
The script will subscribe to avmd events and output them to the console.
2016-09-13 21:46:13 +01:00
Piotr Gregor
849918fd99 FS-9458: [avmd] Set channel variable before BEEP event is fired
Now channel variable is properly set when event is delivered.
2016-09-09 01:12:40 +01:00
Piotr Gregor
9e0ade83b8 FS-9143 [avmd] #fix event headers
Make all headers starting from capital letter.
2016-08-22 09:32:09 +01:00
Piotr Gregor
e5fc843c41 FS-9447: [mod_avmd] #fix PRId64 on windows
We need to include inttypes.h header on Windows
for this to work.
2016-08-20 15:12:43 +01:00
Piotr Gregor
169f1c0b50 FS-9447: [mod_avmd] increase factory default value of samples to skip
Increase the value of parameter for factory settings (used when
config can't be loaded or on 'set default' command).
2016-08-19 20:20:24 +01:00
Piotr Gregor
fb065a148a FS-9447: [mod_avmd] increase default value of samples to skip
Increase value of samples to skip at the beginning of new frame.
This increases the robustness against false detections observed
on German voicemail from Switzerland (see wav audio attached
to case FS-9447).
2016-08-19 19:44:31 +01:00
Piotr Gregor
9fbf9d02e3 FS-9069: [mod_avmd] add detection time to beep event
Add detection time to BEEP event and total session running
time to STOP event.
2016-08-08 17:23:57 +01:00
Piotr Gregor
d49b66c922 FS-9009 [mod_avmd] #fix warning on Windows
Initialize variance of amplitude - avoid (incorrect) warning
2016-07-08 17:46:28 +01:00
Piotr Gregor
6d614ac1a7 FS-9009 [mod_avmd] #fix build on Windows
Windows VC doesn't accept function __attribute__(s)
2016-07-08 17:07:23 +01:00
Piotr Gregor
a77387456d FS-9009 [mod_avmd] Amplitude estimation
Add DESA-2 estimation of signal amplitude
2016-07-04 16:33:58 +01:00
Piotr Gregor
ee4c01b05e FS-9254: [avmd] fix windows build
Fix int-to-uint8_t conversion warnings
due to usage of switch_true when parsing config
2016-06-10 23:32:21 +02:00
Piotr Gregor
54d7c13a11 FS-9142 [avmd] Dynamic settings
Add check of per session settings
in avmd_callback and init_avmd_session
2016-06-05 15:56:06 +01:00
Piotr Gregor
eb369130d9 FS-9142 [avmd] Dynamic settings
Add checking of per session settings
with locking synced on avmd session mutex
2016-05-30 23:23:16 +02:00
Piotr Gregor
1ea32d4009 FS-9010 [avmd] Dynamic passing of parameters
Add dynamic passing of parameters, initialize
session to dynamically passed arguments
or to default global config if dynamic init fails
2016-05-12 18:07:26 +01:00
Piotr Gregor
0a5145133b FS-9152 [avmd] #fix warnings on FreeBSD
Use function __isnan to avoid __Generic
type extension on FreeBSD. Clang 3.4.1 complains
about -Wc++11-extensions even when it has them
defined.
2016-05-12 02:24:14 +01:00
Piotr Gregor
9415487ae9 FS-9124 [avmd] Extend XML config
Add number of continuous streak samples.
2016-05-03 16:55:02 +01:00
Piotr Gregor
f476e23c00 FS-9117 [avmd] #fix build on Windows 2016-04-29 19:27:55 +01:00
Piotr Gregor
bf140e9b68 FS-9011 [avmd] Add XML config
Add XML configuration file.
Bind reloadxml callback.
Add safe parsers of user's input.
Add show/set/load/reload API commands.
2016-04-28 14:22:51 +01:00
Piotr Gregor
bfd8ef08b3 FS-9085, FS-9024: [avmd] Add events
Add start/stop events. Add registration
method, add fire events method.
2016-04-21 00:16:40 +01:00
Piotr Gregor
a54a5797b7 FS-9024: [avmd] Add events
Add sesion start/stop events.
2016-04-20 14:59:39 +01:00
Piotr Gregor
bcddd3da15 FS-9030, FS-9050: [avmd] Fix APP interface
Now avmd can be properly called from dialplan.
Application interface to start/stop avmd
session consists of start/stop app methods.
Backward compatible, old APP syntax left
but will be described in docs as deprecated.
2016-04-13 18:21:13 +01:00
Piotr Gregor
68c2c5d485 FS-9039: [avmd] Use FS enumeration
Now initialization function returns switch_status_t.
2016-04-09 20:05:52 +01:00
Piotr Gregor
c442be0f40 FS-9036: [avmd] Cast to unsigned
Should fix warnings on Windoze.
2016-04-07 20:08:25 +01:00
Piotr Gregor
8baf10d266 FS-9031: [avmd] Check session initialization
Now avmd session's initialization is checked
for errors. Error reporting is improved.
2016-04-07 18:08:41 +01:00
Piotr Gregor
2197794e55 FS-9031: [avmd] Check session initialization
Now avmd session's initialization is checked
for errors. Error reporting is improved.
2016-04-07 17:14:56 +01:00
Piotr Gregor
7dd77c781e FS-9028: [avmd] Check SMA buffer
Now SMA buffer is checked for successful memory
allocation dynamically with assertion omitted.
2016-04-07 16:10:34 +01:00
Piotr Gregor
cc05abc0d4 FS-9027: [avmd] Check buffer
Now buffer is checked for successful memory
allocation dynamically with assertion omitted.
2016-04-06 23:08:21 +01:00
Piotr Gregor
73cc5ae3c1 FS-9020 Avmd internal/external channel
Implement checking of proper configuration
of avmd session being started on internal/external
channels. Check for read/write codec, CF_MEDIA_SET.
2016-04-06 17:57:15 +01:00
Piotr Gregor
4fa43a2442 [avmd] FS-9023 Add console auto completion
Now auto completion is enabled.
2016-04-05 17:09:17 +01:00
Piotr Gregor
439be5d122 [avmd] FS-9019 Extend syntax description
Add commands to syntax description.
2016-04-05 15:48:48 +01:00
Mike Jerris
f32edbb936 FS-8875: [mod_avmd] fix windows build from this change 2016-04-04 17:00:25 -04:00
Piotr Gregor
0a893bac2f FS-9016 Avmd segfaults on NULL read codec
Now it will simply exit. Also added more
descriptive and clear error reporting.
2016-04-04 17:03:30 +01:00
Piotr Gregor
c9d027ea91 FS-8875 Enable faster beep detection
Unnecessary computation of arc cosine is omitted
and convergence is checked on partial results.
Original frequency is easily retrieved when needed.
2016-03-29 23:41:13 +01:00
Piotr Gregor
906e844010 FS-8988 Rename files 2016-03-29 20:53:31 +01:00
Piotr Gregor
6658f61ccd FS-8983 [avmd] Enable avmd on outbound channel
It is possible now to do avmd on outgoing channel
which is very handy while debugging.
2016-03-28 02:51:07 +01:00
Mike Jerris
9e6593aa73 Merge pull request #762 in FS/freeswitch from ~PIOTRGREGOR/freeswitch:bugfix/FS-8961-avmd-increase-robustness-of-variance to master
* commit '63a30499dbb8d280dbf4d18b393aa68ac3ce8c15':
  FS-8961 Increase robustness of estimation
2016-03-21 15:36:41 -05:00
Piotr Gregor
63a30499db FS-8961 Increase robustness of estimation
Add optional requirement of consecutive streak
of estimations in SMA buffer. Fix definitions.
Add options to control debugging/printing.
2016-03-21 00:10:36 +00:00
Piotr Gregor
fce7cfee35 FS-8960 Set buffer position to beginning on reset
Now buffer position is reset to 0.
2016-03-19 23:43:50 +00:00
Piotr Gregor
f561f1cdd6 FS-8855 fix calc of variance of tone's freq estimator
Change SMA buffer APPEND_SMA_VAL macro so now the variance
of tone's frequency estimation is correctly calculated.
Change frequency advertised in log on beep detection from
most recently computed value to average of all values used
in DESA computation.
2016-03-17 12:39:03 +00:00
Mike Jerris
000fdbd2d8 Merge pull request #742 in FS/freeswitch from ~PIOTRGREGOR/freeswitch:bugfix/FS-8853-enable-change-of-resolution-and-size-2 to master
* commit 'da7be641bac16dbe5575c0f266a10d1819ab0026':
  FS-8853 enable change of resolution of fast arc cos table
2016-03-15 16:13:22 -05:00
Piotr Gregor
1c39305fad FS-8810 fix crash on FS startup
The float-int-float fast arc cosine
mapping is now properly constructed (reused).
2016-03-12 00:20:17 +00:00
Piotr Gregor
da7be641ba FS-8853 enable change of resolution of fast arc cos table
It is possible now to apply lower resolution to mapping
of float-integer-float and decrease size of mapped file.
2016-03-11 19:27:21 +00:00
Mike Jerris
9f9078b6f6 Merge pull request #713 in FS/freeswitch from ~PIOTRGREGOR/freeswitch:bugfix/FS-8854-initialize-circular-buffer to master
* commit '3af3e54a6f287b9b045cbe62249b5eecde2b4f80':
  FS-8854 initialize circular buffer
2016-03-10 14:09:06 -06:00
Piotr Gregor
3af3e54a6f FS-8854 initialize circular buffer
Now all members of buffer are initialized
in INIT_CIRC_BUFFER macro.
2016-02-22 11:15:10 +00:00
Piotr Gregor
1e8d315178 FS-8852 change stop condition in for loop
Now we use predefined table length instead
of hardcoded computation in stop condition
of for loop.
2016-02-20 18:02:16 +00:00
Piotr Gregor
b8a8c88572 FS-8809 fix MAP_POPULATE undeclared
Add AM_MOD_AVMD_CXXFLAGS compile flag to mod avmd
and set this flag to -std=gnu99 in configure.ac
in case compiler vendor is xgnu.
2016-02-08 23:02:22 +00:00
Piotr Gregor
6d8fd0def6 refactor: fix comments
Applying code guidelines. No side effects.
2016-02-05 21:42:09 +00:00