<html><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:13px"><div id="yiv8233233383yui_3_16_0_1_1431687459376_20001" class="" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 16px;"><span class="" id="yui_3_16_0_1_1434454535459_4969" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px;">Hello all,</span><br class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px;"><br class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px;"></div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21578" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px;">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)<div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_22003" style=""><br class="" style="">The script should collect digits, similar to:&nbsp;</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21781" style=""><br class="" style="">freeswitch.consoleLog("notice" , "Before GetDigits\n");&nbsp;</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21810" style="">digits = session:getDigits(1, "#", 10000);&nbsp;</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21819" style="">freeswitch.consoleLog("notice" , "AFTER GetDigits\n");&nbsp;</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21828" style="">session:execute('flush_dtmf'); &nbsp;</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21837" style="">freeswitch.consoleLog("notice" , "flush DTMF 2\n");&nbsp;</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_22002" style="">freeswitch.consoleLog("notice" , "After Get Digits" .. "\n");&nbsp;</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21657" style="">freeswitch.consoleLog("notice" , "digits = " .. digits .. "\n");<br class="" style=""><br class="" style=""><br class="" style=""></div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21577" style="">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:<div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21953" style=""><br class="" style=""><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21952" style=""><br class="" style=""></div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21954" style="">EXECUTE sofia/test/2001@test flush_dtmf()</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21955" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21971" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21970" style="">2015-05-15 07:09:39.694302</span></span>&nbsp;[DEBUG] mod_erlang_event.c:169 Ignoring event CHANNEL_EXECUTE for attached session d7e76764-faf2-11e4-8f50- 771905ed12f6</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21956" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21969" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" style="" id="yui_3_16_0_1_1434454535459_8828">2015-05-15 07:09:39.694302</span></span>&nbsp;[DEBUG] mod_erlang_event.c:169 Ignoring event CHANNEL_EXECUTE_COMPLETE for attached session d7e76764-faf2-11e4-8f50- 771905ed12f6</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21957" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21968" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" style="" id="yui_3_16_0_1_1434454535459_8827">2015-05-15 07:09:39.694302</span></span>&nbsp;[INFO] switch_cpp.cpp:1291 UUID: d7e76764-faf2-11e4-8f50- 771905ed12f6</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21958" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21967" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_23999" style="">2015-05-15 07:09:39.714301</span></span>&nbsp;[NOTICE] switch_cpp.cpp:1291 1234 Before GetDigits</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21959" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21966" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" style="" id="yui_3_16_0_1_1434454535459_8787">2015-05-15 07:09:42.034319</span></span>&nbsp;[DEBUG] switch_rtp.c:5788 RTP RECV DTMF 1:1120</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21960" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21965" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" style="" id="yui_3_16_0_1_1434454535459_8786">2015-05-15 07:09:42.034319</span></span>&nbsp;[DEBUG] switch_channel.c:486 RECV DTMF 1:1120</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21961" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_23998" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_23997" style="">2015-05-15 07:09:42.034319</span></span>&nbsp;[DEBUG] mod_dptools.c:2138 Digit 1</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21962" style=""><span class="" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);" id="yui_3_16_0_1_1434454535459_8766"><span class="" style="" id="yui_3_16_0_1_1434454535459_8765">2015-05-15 07:09:42.034319</span></span>&nbsp;[DEBUG] mod_erlang_event.c:157 Sending event DTMF to attached session d7e76764-faf2-11e4-8f50- 771905ed12f6</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21963" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21987" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" style="" id="yui_3_16_0_1_1434454535459_8767">2015-05-15 07:09:49.714345</span></span>&nbsp;[DEBUG] switch_cpp.cpp:838 getDigits dtmf_buf:&nbsp;</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21964" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21988" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_23996" style="">2015-05-15 07:09:49.714345</span></span>&nbsp;[NOTICE] switch_cpp.cpp:1291 1234 AFTER GetDigits</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21972" style="">EXECUTE sofia/test/2001@test flush_dtmf()</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21973" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21989" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" style="" id="yui_3_16_0_1_1434454535459_8768">2015-05-15 07:09:49.714345</span></span>&nbsp;[DEBUG] mod_erlang_event.c:169 Ignoring event CHANNEL_EXECUTE for attached session d7e76764-faf2-11e4-8f50- 771905ed12f6</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21974" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_23995" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_23994" style="">2015-05-15 07:09:49.714345</span></span>&nbsp;[NOTICE] switch_cpp.cpp:1291 flush DTMF 2</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21975" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21990" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_24000" style="">2015-05-15 07:09:49.714345</span></span>&nbsp;[NOTICE] switch_cpp.cpp:1291 After Get Digits</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21992" style=""><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21991" style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204);"><span class="" id="yiv8233233383yui_3_16_0_1_1431687459376_23993" style="">2015-05-15 07:09:49.714345</span></span>&nbsp;[NOTICE] switch_cpp.cpp:1291 digits =&nbsp;</div></div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21993" style=""><br class="" style="">I also looked in the freeswitch code:<br class="" style=""><a rel="nofollow" target="_blank" href="https://freeswitch.org/fisheye/browse/freeswitch/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c?hb=true#to159" class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21994" style="color: rgb(17, 85, 204);">https://freeswitch.org/ fisheye/browse/freeswitch/src/ mod/event_handlers/mod_erlang_ event/mod_erlang_event.c?hb= true#to159</a><br class="" style=""><br class="" style="">and it seems that the DTMF event is properly cloned and added to current session queue.</div><div class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21993" style=""><br class="" style=""></div></div></div><div dir="ltr" class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21995" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px;">Please advise.</div><div dir="ltr" class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21995" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px;"><br></div><div dir="ltr" class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21995" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px;">Thank you!</div><div dir="ltr" class="" id="yiv8233233383yui_3_16_0_1_1431687459376_21995" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px;"><br></div><div class="" style="" id="yui_3_16_0_1_1434454535459_8773"><br class="" style=""></div></div></body></html>