Catching DTMF with Manager API


#1

I’m building an app to connect to the manager API. So far everything is fine, but I also have to be able to receive DTMF events through the manager API.

I have been searching, but I haven’t found a way to do this. All I found was a post of someone wanting to add this feature a couple of months ago:
http://lists.digium.com/pipermail/asterisk-dev/2005-May/012719.html

Is this possible, and if so, how?

Thanks for your effort.


#2

There is not a direct way to do this but there may be a couple of work arounds. First, you may use the ManagerAPI in conjunction with a logic set in extensions.conf to capture DTMF in a variable and then obtain that variable via the ManagerAPI using a command like this:

phpagi.sourceforge.net/phpagi2/d … tml#GetVar

Or as part of your logic you may trigger a call that ends up at an AGI and collect the digits this way, using this command:

phpagi.sourceforge.net/phpagi2/d … s_get_data


#3

Thank you for the solution, I am now using the first option:

[testdtmf]
exten => s,1,Answer()
exten => s,2,ResponseTimeout(60)
exten => _X,1,NoOp(dtmf-${EXTEN})
exten => _X,2,Goto(testdtmf|s|2)
exten => _#,1,NoOp(dtmf-${EXTEN})
exten => _#,2,Goto(testdtmf|s|2)
exten => _,1,NoOp(dtmf-${EXTEN})
exten => _
,2,Goto(testdtmf|s|2)
exten => i,1,Goto(testdtmf|s|2)
exten => h,1,Hangup
exten => t,1,Goto(testdtmf|s|2)

PS: I don’t use _. so as to only get one DTMF at a time