mod_stress attempts to detect stress in a person's voice and generates FreeSWITCH events based on that data.
Click here to expand Table of Contents
How does this work?
The module uses FFT to calculate the power spectrum of the call. It then attempts to recognise patterns that may imply stress. For example a strong tremor or volume.
Please note that this will be highly unreliable, generating many false positives/negatives.
The stress app attaches hooks to the channel to listen to the media in one direction.
stress [ read | write | stop ]
The read parameter (default) listens for stress on the caller's direction, write for stress on the callee's direction and stop removes any previously attached hooks.
CLI / ESL
The dialplan app can also be invoked on a channel from the console or via ESL (eg fs_cli):
uuid_broadcast <uuid> stress::read
uuid_broadcast <uuid> stress::stop
When stress is detected this event is fired. Note both Event-Name and Speech-Type, other modules will raise DETECTED_SPEECH but with a different Speech-Type. Example:
If you whistle into your phone you should see the following messages (example):
2013-01-22 15:51:50.546923 [DEBUG] mod_stress.cpp:173 Stress 20000.00
2013-01-22 15:51:51.566922 [DEBUG] mod_stress.cpp:173 Stress 20000.00
2013-01-22 15:51:53.606924 [DEBUG] mod_stress.cpp:173 Stress 20000.00
2013-01-22 15:51:54.626923 [DEBUG] mod_stress.cpp:173 Stress 20000.00
2013-01-22 15:51:55.666926 [DEBUG] mod_stress.cpp:173 Stress 392.78
2013-01-22 15:51:56.686923 [DEBUG] mod_stress.cpp:173 Stress 0.17
This will confirm the module is listening to speech on the line.