diff options
author | Matthew Jordan <mjordan@digium.com> | 2014-05-30 12:42:57 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2014-05-30 12:42:57 +0000 |
commit | 53968c00b34a913e0467200b95add483f79dd3b6 (patch) | |
tree | 3e04113a3c4eda1884205df78e9527b2c72cee6a /main/audiohook.c | |
parent | e9f09ab2bce1e1aa1b619507b45d228bbc49f12c (diff) |
TALK_DETECT: A channel function that raises events when talking is detected
This patch adds a new channel function TALK_DETECT that, when set on a
channel, causes events indicating the start/stop of talking on a channel to be
emitted to both AMI and ARI clients.
The function allows setting both the silence threshold (the length of silence
after which we decide no one is talking) as well as the talking threshold (the
amount of energy that counts as talking). Parameters can be updated on a channel
after talk detection has been enabled, and talk detection can be removed at
any time.
The events raised by the function use a nomenclature similar to existing AMI/ARI
events.
For AMI: ChannelTalkingStart/ChannelTalkingStop
For ARI: ChannelTalkingStarted/ChannelTalkingFinished
Review: https://reviewboard.asterisk.org/r/3563/
#ASTERISK-23786 #close
Reported by: Matt Jordan
........
Merged revisions 414934 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/audiohook.c')
-rw-r--r-- | main/audiohook.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/main/audiohook.c b/main/audiohook.c index 90802b6cd..4dc7c136b 100644 --- a/main/audiohook.c +++ b/main/audiohook.c @@ -874,17 +874,15 @@ static struct ast_frame *audio_audiohook_write_list(struct ast_channel *chan, st } audiohook_set_internal_rate(audiohook, audiohook_list->list_internal_samp_rate, 1); /* Feed in frame to manipulation. */ - if (audiohook->manipulate_callback(audiohook, chan, middle_frame, direction)) { - /* XXX IGNORE FAILURE */ - + if (!audiohook->manipulate_callback(audiohook, chan, middle_frame, direction)) { /* If the manipulation fails then the frame will be returned in its original state. * Since there are potentially more manipulator callbacks in the list, no action should * be taken here to exit early. */ + middle_frame_manipulated = 1; } ast_audiohook_unlock(audiohook); } AST_LIST_TRAVERSE_SAFE_END; - middle_frame_manipulated = 1; } /* ---Part_3: Decide what to do with the end_frame (whether to transcode or not) */ |