Cannot receive DTMF events
Closed this issue · 3 comments
I try to listen to DTMF events. My code looks like:
var call_handler = function () {
this.ev.on('DTMF', function (call) {
console.log('entered number')
})
this.execute('answer');
}
var server = esl.server(call_handler)
server.listen(3000);
It worked fine in the old 0.3.2 version, but does not work with 2.1.1. Do you have any ideas?
The event interface is kinda wacky (and might need to be corrected), try:
this.on('DTMF').then( function (msg) { ... })
EDIT: Actually the function is called just like the call-handler with this
set to the 0.3.x call
object.
EDIT: The function will receive the event message (msg.headers
and msg.body
are set).
@shimaore thanks for the guide. It still does not work.
Problem is, that I do not see the event in FreeSwitchParser where we listen on this.socket.on('data', (...)}
. Looks like this.event_json('ALL');
in FreeSwitchServer send the event request, but afterwards I do not get all events over wire. I only receive the basic call events. Any ideas?
P.S. Freeswitch is configured properly, because it works with the old version of esl without any hassle.