Variable to get the audio level from the channel

Good morning,

I need to get the audio level of a channel in real time to execute some script.

Example:

  • If the caller is talking, then send DTMF
  • If the caller stops talking, then send another DTMF

I have the script made correctly but I need to get the audio level.

Is there any way to it??

Thanks in advance,

Best regards

There is not built-in way. There is an audiohooks infrastructure which would allow this to be added by a C programmer. There is potentially quite a high overhead involved in poling and updating such a variable.

I get a strong feeling that you would be better off asking for solutons to the underlying requirement, rather than this sort of technical solution to it.

But asterisk comes with two apps called WaitforSilence and WaitForNoise.

I think I can use that apps for my needs :confused:

I only need to send a DTMF when audio is sended…

Those applications cannot be used once a call is connected. They would typically be used for automated cold calling, where Asterisk will Originate the call then connect to the cold call extension, which will use to try to decide the best time to send the annoying message.

You still haven’t explained what you are really trying to achieve.