<html><body><div style="color:; background-color:; font-family:lucida console, sans-serif;font-size:13px"><div id="yiv7599823927"><div id="yui_3_16_0_1_1431687459376_23937"><div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:16px;" id="yui_3_16_0_1_1431687459376_23936"><div id="yiv7599823927yui_3_16_0_1_1431687459376_20001" class="yiv7599823927" style=""><span style="color:rgb(34, 34, 34);font-family:arial, sans-serif;font-size:12.8000001907349px;" class="yiv7599823927">Hello all,</span><br style="color:rgb(34, 34, 34);font-family:arial, sans-serif;font-size:12.8000001907349px;" class="yiv7599823927"><br style="color:rgb(34, 34, 34);font-family:arial, sans-serif;font-size:12.8000001907349px;" class="yiv7599823927"></div><div style="color:rgb(34, 34, 34);font-family:arial, sans-serif;font-size:12.8000001907349px;" class="yiv7599823927" id="yiv7599823927yui_3_16_0_1_1431687459376_21578">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="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_22003"><br class="yiv7599823927" style="">The script should collect digits, similar to:&nbsp;</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21781"><br class="yiv7599823927" style="">freeswitch.consoleLog("notice" , "Before GetDigits\n");&nbsp;</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21810">digits = session:getDigits(1, "#", 10000);&nbsp;</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21819">freeswitch.consoleLog("notice" , "AFTER GetDigits\n");&nbsp;</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21828">session:execute('flush_dtmf'); &nbsp;</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21837">freeswitch.consoleLog("notice" , "flush DTMF 2\n");&nbsp;</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_22002">freeswitch.consoleLog("notice" , "After Get Digits" .. "\n");&nbsp;</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21657">freeswitch.consoleLog("notice" , "digits = " .. digits .. "\n");<br class="yiv7599823927" style=""><br class="yiv7599823927" style=""><br class="yiv7599823927" style=""></div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21577">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="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21953"><br class="yiv7599823927" style=""><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21952"><br class="yiv7599823927" style=""></div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21954">EXECUTE sofia/test/2001@test flush_dtmf()</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21955"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21971"><span class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21970">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="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21956"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21969"><span class="yiv7599823927" style="">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="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21957"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21968"><span class="yiv7599823927" style="">2015-05-15 07:09:39.694302</span></span>&nbsp;[INFO] switch_cpp.cpp:1291 UUID: d7e76764-faf2-11e4-8f50- 771905ed12f6</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21958"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21967"><span class="yiv7599823927" style="" id="yui_3_16_0_1_1431687459376_23999">2015-05-15 07:09:39.714301</span></span>&nbsp;[NOTICE] switch_cpp.cpp:1291 1234 Before GetDigits</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21959"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21966"><span class="yiv7599823927" style="">2015-05-15 07:09:42.034319</span></span>&nbsp;[DEBUG] switch_rtp.c:5788 RTP RECV DTMF 1:1120</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21960"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21965"><span class="yiv7599823927" style="">2015-05-15 07:09:42.034319</span></span>&nbsp;[DEBUG] switch_channel.c:486 RECV DTMF 1:1120</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21961"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yui_3_16_0_1_1431687459376_23998"><span class="yiv7599823927" style="" id="yui_3_16_0_1_1431687459376_23997">2015-05-15 07:09:42.034319</span></span>&nbsp;[DEBUG] mod_dptools.c:2138 Digit 1</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21962"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);"><span class="yiv7599823927" style="">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="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21963"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21987"><span class="yiv7599823927" style="">2015-05-15 07:09:49.714345</span></span>&nbsp;[DEBUG] switch_cpp.cpp:838 getDigits dtmf_buf:&nbsp;</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21964"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21988"><span class="yiv7599823927" style="" id="yui_3_16_0_1_1431687459376_23996">2015-05-15 07:09:49.714345</span></span>&nbsp;[NOTICE] switch_cpp.cpp:1291 1234 AFTER GetDigits</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21972">EXECUTE sofia/test/2001@test flush_dtmf()</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21973"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21989"><span class="yiv7599823927" style="">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="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21974"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yui_3_16_0_1_1431687459376_23995"><span class="yiv7599823927" style="" id="yui_3_16_0_1_1431687459376_23994">2015-05-15 07:09:49.714345</span></span>&nbsp;[NOTICE] switch_cpp.cpp:1291 flush DTMF 2</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21975"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21990"><span class="yiv7599823927" style="" id="yui_3_16_0_1_1431687459376_24000">2015-05-15 07:09:49.714345</span></span>&nbsp;[NOTICE] switch_cpp.cpp:1291 After Get Digits</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21992"><span class="yiv7599823927" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204, 204, 204);" id="yiv7599823927yui_3_16_0_1_1431687459376_21991"><span class="yiv7599823927" style="" id="yui_3_16_0_1_1431687459376_23993">2015-05-15 07:09:49.714345</span></span>&nbsp;[NOTICE] switch_cpp.cpp:1291 digits =&nbsp;</div></div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21993"><br class="yiv7599823927" style="">I also looked in the freeswitch code:<br class="yiv7599823927" 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" style="color:rgb(17, 85, 204);" class="yiv7599823927" id="yiv7599823927yui_3_16_0_1_1431687459376_21994">https://freeswitch.org/ fisheye/browse/freeswitch/src/ mod/event_handlers/mod_erlang_ event/mod_erlang_event.c?hb= true#to159</a><br class="yiv7599823927" style=""><br class="yiv7599823927" style="">and it seems that the DTMF event is properly cloned and added to current session queue.</div><div class="yiv7599823927" style="" id="yiv7599823927yui_3_16_0_1_1431687459376_21993"><br></div></div></div><div style="color:rgb(34, 34, 34);font-family:arial, sans-serif;font-size:12.8000001907349px;" dir="ltr" class="yiv7599823927" id="yiv7599823927yui_3_16_0_1_1431687459376_21995">Please advise</div></div></div></div></div></body></html>