How to define time out for tondetection

Hi everyone,

I try to define time out for tone detect for asterisk system like,


same => n,Set(TONE_DETECT(3000,400,crg(outgoing-calls,tonedetected,1))=)

So, I need to use tone detect just for 5 second. if more than 5 second I need to disable it.
because when I use g function of tone detect it will end the call when detect the frequency.
I need to continue the call or define time out for this function.

many thanks.

Hi nasittide,

Not quite sure what you are trying to achieve, would it not just be:

  • Set tone detect (go to g when detected)
  • Wait 5
  • Stop tone detect

The docs have examples almost identical to this:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+19+Function_TONE_DETECT

If you mean something else would you be able to share more code with comments or what the g context is doing?

Thanks

Thank about sample socallmemaybe,

but when I go to g function it hangs up dialing that it needs to stop tone detect but not hang up the call

deleted

Hey nasittide, sorry its difficult to help without seeing more dialplan code, or a minimum version of code which emulates the problem you are facing.