[Home]

Summary:ASTERISK-28462: func_talkdetect: TALK_DETECT firing immediately even if phone microphone is muted
Reporter:Matt Altepeter (maltepet)Labels:
Date Opened:2019-06-25 15:42:59Date Closed:2021-10-14 14:47:45
Priority:MajorRegression?
Status:Closed/CompleteComponents:Functions/func_talkdetect
Versions:16.4.0 Frequency of
Occurrence
Related
Issues:
duplicatesASTERISK-27816 func_talkdetect's logic is completely broken
Environment:Attachments:
Description:This issue on the community forums provides a bit more background on the issue: https://community.asterisk.org/t/issues-with-talk-detect-and-ari/80096/10

But essentially, when I call into a number with talk detect set and then going to a stasis application, the sound file playback (first step that stasis executes) stops playback immediately because when I receive the ChannelTalkingStarted event I want to stop the playback of the file. This occurs even when the microphone is muted prior to the call being answered.

The speculation, as seen in the link above, is that total_silence is set to an extremely low value.

This issue was able to be replicated via the AMI as well
Comments:By: Asterisk Team (asteriskteam) 2019-06-25 15:43:00.188-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Joshua C. Colp (jcolp) 2019-06-26 11:31:36.458-0500

From [~kharwell] on forum:

{noformat}
I think this may be a bug in Asterisk. Here’s the code that sets “talking” (from func_talkdetect.c):

ast_dsp_silence(td_params->dsp, frame, &total_silence);

if (total_silence < td_params->dsp_silence_threshold) {
   if (!td_params->talking) {
update_talking = 1;
td_params->talking_start = ast_tvnow();
}
td_params->talking = 1;
}

I’m guessing total_silence here starts out at zero or some really low number. Either way it is most likely less than the dsp_silence_threshold value. If so then it would trigger talking every time at start.

Anyhow, I was able to replicate the problem as well when watching for AMI events. Please create a bug report on our issue tracker. Describe the problem, and feel free to add a link to your post here.
{noformat}

By: Richard Frith-Macdonald (richardfm) 2021-10-05 10:42:16.074-0500

I'm seeing this issue too (currently using asterisk-18.5.0).
Is there any timescale for TALK_DETECT to work properly with ARI?

By: Richard Frith-Macdonald (richardfm) 2021-10-05 10:44:21.386-0500

I think this issue might be related to ASTERISK-27816

By: Joshua C. Colp (jcolp) 2021-10-05 10:53:55.172-0500

I'm not sure what you mean by timescale, but there is noone actively working on this issue.

By: Richard Frith-Macdonald (richardfm) 2021-10-05 11:19:29.115-0500

I meant some idea of how long it might be before fixed.
I'm not familiar enough with the asterisk source, so I don't really know what the patch in ASTERISK-27816 is actually doing, but I suppose I could try applying it and see if it fixes the problem.

By: Joshua C. Colp (jcolp) 2021-10-05 11:26:56.443-0500

There is no time frame.

By: Richard Frith-Macdonald (richardfm) 2021-10-08 10:04:02.950-0500

I used the patch from ASTERISK-27816 ​and it seems to work.
​The whole thing is about a dozen lines, one of which is correcting the content of a warning log.
The logic change is very simple, and at least seems to fix the bug of talk detect firing immediately (before any speech is detected).