Hello all,

I have a mod_erlang_event based application and I need to run a lua script within for playing prompt and colecting digits (I use freeswith api and luarun from erlang code for running lua script)

The script should collect digits, similar to: 

freeswitch.consoleLog("notice" , "Before GetDigits\n"); 
digits = session:getDigits(1, "#", 10000); 
freeswitch.consoleLog("notice" , "AFTER GetDigits\n"); 
session:execute('flush_dtmf');  
freeswitch.consoleLog("notice" , "flush DTMF 2\n"); 
freeswitch.consoleLog("notice" , "After Get Digits" .. "\n"); 
freeswitch.consoleLog("notice" , "digits = " .. digits .. "\n");


However, the digits are not collected (sometimes this scenario works OK but I cannot identify a pattern), as can be seen from the logs below:


EXECUTE sofia/test/2001@test flush_dtmf()
2015-05-15 07:09:39.694302 [DEBUG] mod_erlang_event.c:169 Ignoring event CHANNEL_EXECUTE for attached session d7e76764-faf2-11e4-8f50- 771905ed12f6
2015-05-15 07:09:39.694302 [DEBUG] mod_erlang_event.c:169 Ignoring event CHANNEL_EXECUTE_COMPLETE for attached session d7e76764-faf2-11e4-8f50- 771905ed12f6
2015-05-15 07:09:39.694302 [INFO] switch_cpp.cpp:1291 UUID: d7e76764-faf2-11e4-8f50- 771905ed12f6
2015-05-15 07:09:39.714301 [NOTICE] switch_cpp.cpp:1291 1234 Before GetDigits
2015-05-15 07:09:42.034319 [DEBUG] switch_rtp.c:5788 RTP RECV DTMF 1:1120
2015-05-15 07:09:42.034319 [DEBUG] switch_channel.c:486 RECV DTMF 1:1120
2015-05-15 07:09:42.034319 [DEBUG] mod_dptools.c:2138 Digit 1
2015-05-15 07:09:42.034319 [DEBUG] mod_erlang_event.c:157 Sending event DTMF to attached session d7e76764-faf2-11e4-8f50- 771905ed12f6
2015-05-15 07:09:49.714345 [DEBUG] switch_cpp.cpp:838 getDigits dtmf_buf: 
2015-05-15 07:09:49.714345 [NOTICE] switch_cpp.cpp:1291 1234 AFTER GetDigits
EXECUTE sofia/test/2001@test flush_dtmf()
2015-05-15 07:09:49.714345 [DEBUG] mod_erlang_event.c:169 Ignoring event CHANNEL_EXECUTE for attached session d7e76764-faf2-11e4-8f50- 771905ed12f6
2015-05-15 07:09:49.714345 [NOTICE] switch_cpp.cpp:1291 flush DTMF 2
2015-05-15 07:09:49.714345 [NOTICE] switch_cpp.cpp:1291 After Get Digits
2015-05-15 07:09:49.714345 [NOTICE] switch_cpp.cpp:1291 digits = 

I also looked in the freeswitch code:
https://freeswitch.org/ fisheye/browse/freeswitch/src/ mod/event_handlers/mod_erlang_ event/mod_erlang_event.c?hb= true#to159

and it seems that the DTMF event is properly cloned and added to current session queue.

Please advise