How to Call custom UserEvent when no DTMF digit are pressed

Hello Team,

I am facing a problem with DTMF digit when no DTMF digit are pressed from customer end then how to trigger a custom AMI event in this case.

Here below example I want to execute custom User Event when no DTMF digit are pressed.

Dial plan e.g.,
[incoming]
exten => _X.,1,NoOp(Incoming Call)
same => n,Answer()
same => n,Wait(10)
same =>n,UserEvent(testsample, Channel: $CHANNEL)
same =>n,Hangup()

Please help me on this

You don’t have anything that is looking for DTMF.

Hi David,

Thanks for your quick response …
Within wait time (10 seconds) customer press dtmf digit then internal AMI functionality called and performed certain task.
If you know the way how to work when no DTMF is being pressed by customer.
Please suggest your suggestion

Normally you would issue Read() an look at its response.

Can you explain why you cannot do this?

As you are doing this all in AMI, my first suggestions would be for the timeout to be implemented in the AMI client. My fallback suggestion would be that you redefine the user event to represent a timeout. I either case no digits is signalled by getting the timeout event without having seen any digits.

Yes David,

Ideally we use timeout but in my case what happen if user press dtmf digit then internal AMI event works and in case when no dtmf digit being pressed by user internal dtmf timeout event won’t work .
Actually AMI received Send/ Receive event on dtmf digit press…
Can you tell me where i need to place dtmf timeout in case of no dtmf is being pressed .

There are lots of AMI events you could use to detect the start of the call and start the timeout.

any example please suugest

I would prefer use Read() app and then conditional evaluation if variable value is NULL
generate custom AMI event

You didn’t say why you couldn’t use Read(), but if there is a valid reason, you require bespoke coding for something that is not normally done. You are unlikely to get a worked example, and even less likely to get one that has been properly tested.

Thanks @david551 / @ambiorixg12 for your valuable suggestion.

My requirement is some how different… let me share the sample code again and explain each steps one by one

exten => _X.,1,NoOp(Incoming Call)
same => n,Answer()
same => n,Set(timer=10)
same => n,Set(interval=5)
same => n,While($[${timer}>0])
same => n,Wait(${interval})
same => n,UserEvent(ChannelDtmfReceived, Channel: ${CHANNEL}, UniqueId: ${UNIQUEID})
same => n,Set(timer=$[${timer} -${interval}])
same => n,EndWhile()
same => n, Hangup()

You can see in above dialplan, total execution time is 10 seconds for each call and interval is of 5 seconds.
dialplan wait for 5 seconds to read DTMF digit ( Received / Sent) after that UserEvent will execute and read dtmf digit to send through ChannelDtmfReceivedEvent.
Next timer set with 5 seconds and repeat the loop after complete the loop hangup the code.

Here is the problem if user didn’t press any digit in Wait() time then how we can pass blank / EMPTY parameter to AMI
Also if user didn’t press any DTMF digit till Wait() AMI will not execute and no logs is shown in backend

Please suggest the way

Hello Team,

Any suggestion :slight_smile:
Please let me know , waiting for your response