# TALK DETECTION script

**URL:** <https://community.asterisk.org/t/talk-detection-script/95169>\
**Category:** Asterisk Dialplan\
**Created:** [December 22, 2022, 6:58am UTC](https://community.asterisk.org/t/talk-detection-script/95169 "2022-12-22T06:58:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![samkghosh](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samkghosh](https://community.asterisk.org/u/samkghosh)\
**Post date:** [December 22, 2022, 6:58am UTC](https://community.asterisk.org/t/talk-detection-script/95169/1 "2022-12-22T06:58:19Z")

</div>

Hi,  
I am not an experienced asterisk programmer. Can any one help me writing a dial plan for talk detection. Scenario is as follows: An incoming call is answered. Then When there a voice and no voice it should trigger event/or message.  
Thanks in advance.

regards  
Samir

---

<div class="post-metadata">

**Author:** ![Chano](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/chano/32/3448_2.png) [@Chano](https://community.asterisk.org/u/Chano)\
**Post date:** [December 22, 2022, 10:28am UTC](https://community.asterisk.org/t/talk-detection-script/95169/2 "2022-12-22T10:28:58Z")

</div>

What is the goal? Perhaps there’s another/easier/better way to do it?

---

<div class="post-metadata">

**Author:** ![PitzKey](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pitzkey/32/5827_2.png) [@PitzKey](https://community.asterisk.org/u/PitzKey)\
**Post date:** [December 22, 2022, 2:38pm UTC](https://community.asterisk.org/t/talk-detection-script/95169/3 "2022-12-22T14:38:33Z")

</div>

[https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Application\_AMD](https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Application_AMD)

[https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function\_TALK\_DETECT](https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_TALK_DETECT)

---

<div class="post-metadata">

**Author:** ![samkghosh](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samkghosh](https://community.asterisk.org/u/samkghosh)\
**Post date:** [December 22, 2022, 4:47pm UTC](https://community.asterisk.org/t/talk-detection-script/95169/4 "2022-12-22T16:47:27Z")

</div>

There is a Radio device connected to a conference room via Radio gateway. When there will be voice coming from radio, it will notify others so that they will join the conference room and listen to the voice in the conference room. This is to indicate there is some noise or voice coming from the radio device so that people will connect to that conference room and listen to the voice.

---

<div class="post-metadata">

**Author:** ![Chano](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/chano/32/3448_2.png) [@Chano](https://community.asterisk.org/u/Chano)\
**Post date:** [December 22, 2022, 8:03pm UTC](https://community.asterisk.org/t/talk-detection-script/95169/5 "2022-12-22T20:03:08Z")

</div>

Sounds like you’d often loose a big chunk from the start of the transmission. But the above mentioned TALK\_DETECT function, and something that listens to AMI for the emitted events, seems like the way to go then.

---

<div class="post-metadata">

**Author:** ![ambiorixg12](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ambiorixg12/32/1887_2.png) [@ambiorixg12](https://community.asterisk.org/u/ambiorixg12)\
**Post date:** [December 22, 2022, 11:03pm UTC](https://community.asterisk.org/t/talk-detection-script/95169/6 "2022-12-22T23:03:26Z")

</div>

Following the same line of @Chano AMI could be way for this. Using Socket connection you can easyl catch those AMI events with PHP, Node …

[Asterisk 18 ManagerEvent\_ChannelTalkingStart](https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+ManagerEvent_ChannelTalkingStart)Page:

[Asterisk 18 ManagerEvent\_ChannelTalkingStop](https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+ManagerEvent_ChannelTalkingStop)

Page: [Asterisk 18 ManagerEvent\_ConfbridgeTalking](https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+ManagerEvent_ConfbridgeTalking)

---

<div class="post-metadata">

**Author:** ![samkghosh](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samkghosh](https://community.asterisk.org/u/samkghosh)\
**Post date:** [December 26, 2022, 6:07am UTC](https://community.asterisk.org/t/talk-detection-script/95169/7 "2022-12-26T06:07:54Z")

</div>

Thanks so much.  
I am capturing the events, but once start and stop comes immediately. After that no more events. What other parameter I should be chaging? The vents comes once.

Regards  
Samir

---

<div class="post-metadata">

**Author:** ![ldo](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@ldo](https://community.asterisk.org/u/ldo)\
**Post date:** [December 27, 2022, 10:20pm UTC](https://community.asterisk.org/t/talk-detection-script/95169/8 "2022-12-27T22:20:52Z")

</div>

EAGI lets you get the real-time audio stream, I believe. Is that helpful?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [January 26, 2023, 10:21pm UTC](https://community.asterisk.org/t/talk-detection-script/95169/9 "2023-01-26T22:21:01Z")

</div>

Closed on January 26, 2023, 10:21pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
