98 Commits

Author SHA1 Message Date
Piotr Gregor
978171592a
[mod_avmd] Add test of CPU usage 2020-02-12 23:47:51 +04:00
Piotr Gregor
b0f09fcff2 [mod_avmd] Unlock and close session if adding a media bug fails 2019-11-12 21:29:29 +04:00
Andrey Volk
e1c9f561b9 FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for mod_avmd 2019-07-15 23:39:44 +04:00
Piotr Gregor
c8e9eeaec9 FS-11708 Fix deadlock on 'avmd uuid stop' 2019-03-15 16:27:14 -06:00
Andrey Volk
671da28796 FS-11263: [Build-System] Move FreeSWITCH build system to Visual Studio 2017 on Windows. 2018-07-24 07:21:55 +00:00
Andrey Volk
561d187085 FS-11125: [Build-System] Remove unused files left from previous Visual Studio version. 2018-07-24 07:21:51 +00:00
Piotr Gregor
80cd1fa422 FS-11120 Handle invalid configs for avmd
This makes sure avmd session uses default values for global settings
if configuration parameters are invalid or missing.
Also add more printing for avmd. Avmd will now report media
bug direction READ_REPLACE/WRITE_REPLACE it has been started on,
and each frame it is processing if debug==1.
This also fixes confusing log on session stopped reported in FS-10732.
2018-04-18 18:01:17 +01:00
Praveen Kumar
179a659b7f FS-10728: [mod_avmd] backward compatibility issue in avmd_main_api
avmd_start_app flow will break if 'inbound_channel'/'outbound_channel'
    both has been set and the avmd_start_app invoked for inbound call leg.

    With this change, it'll be able to work even if we set
    'inbound_channel'/'outbound_channel' both.
2017-11-02 12:52:23 +05:30
Sergey Safarov
df1ab07ca4 FS-9924: Removed extra space in source files 2017-02-09 23:59:49 -05:00
Mike Jerris
a3ee7595bb FS-10025: fix global symbol scope issue causing modules to use another modules global pointer 2017-02-09 17:23:30 -06:00
Sebastian Kemper
8c94e6f57f FS-9840 mod_avmd: Fix implicit declaration warning
Fix the following compile-time warning:

making all mod_avmd
make[7]: Entering directory '/home/sk/tmp/lede/build_dir/target-mips_24kc_musl-1.1.15/freeswitch-1.8.0/src/mod/applications/mod_avmd'
  CC       mod_avmd_la-mod_avmd.lo
mod_avmd.c: In function 'avmd_process_sample':
mod_avmd.c:49:19: error: implicit declaration of function '__isinf' [-Werror=implicit-function-declaration]
 #define ISINF(x) (__isinf(x))
                   ^
mod_avmd.c:2038:33: note: in expansion of macro 'ISINF'
         if (ISNAN(amplitude) || ISINF(amplitude)) {
                                 ^
cc1: all warnings being treated as errors
Makefile:682: recipe for target 'mod_avmd_la-mod_avmd.lo' failed

Fix this by adding the declaration for __isinf(), the same is done for
__isnan() already

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2016-12-23 21:44:30 +01:00
Piotr Gregor
df80234f07 FS-9843 [mod_avmd] Remove unused defines 2016-12-13 10:13:37 +00:00
Piotr Gregor
3734043aaa FS-9627 [avmd]: #fix dynamic initialization of session
Now dynamic initialization of session settings is done
before memory for detection threads is allocated and initialized.
2016-10-13 13:12:16 +01:00
Piotr Gregor
1fd2e91a08 FS-9620 [avmd][windows]: #fix windows build after FS-9605 2016-10-06 17:35:25 +01:00
Piotr Gregor
4583ac8c98 FS-9605: [avmd] Add number of detection threads setting to config
Now the number of dectors and lagged detectors is set in avmd config
and can be dynamically adjusted per each session.
2016-10-05 11:59:54 +01:00
Piotr Gregor
184368d8f4 FS-9568 [avmd] Fail session creation if can't be started properly 2016-10-03 15:05:28 +01:00
Piotr Gregor
b24c2ac945 FS-9595 [avmd] Extend avmd show api
Add number of sessions currently running to output of avmd show api.
2016-10-01 21:41:54 +01:00
Piotr Gregor
b44b6e5b20 FS-9564 [avmd]: add lagged detectors
Addition of detectors which skip first few frames
of audio before they start to process it helps
to properly handle some Verizon voicemails.
The result of avmd test using this commit is
OK. All PASS [100]

Thi scommit also resolves:
FS-9588 Add script for outbound avmdy
FS-9589 Add resolution info to events
2016-09-29 16:53:32 +01:00
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