[Freeswitch-users] Cannot collect digits from lua script

Nicoleta Lazar nicoleta_lazar2006 at yahoo.com
Fri May 15 15:55:15 MSD 2015


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 at 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- 771905ed12f62015-05-15 07:09:39.694302 [DEBUG] mod_erlang_event.c:169 Ignoring event CHANNEL_EXECUTE_COMPLETE for attached session d7e76764-faf2-11e4-8f50- 771905ed12f62015-05-15 07:09:39.694302 [INFO] switch_cpp.cpp:1291 UUID: d7e76764-faf2-11e4-8f50- 771905ed12f62015-05-15 07:09:39.714301 [NOTICE] switch_cpp.cpp:1291 1234 Before GetDigits2015-05-15 07:09:42.034319 [DEBUG] switch_rtp.c:5788 RTP RECV DTMF 1:11202015-05-15 07:09:42.034319 [DEBUG] switch_channel.c:486 RECV DTMF 1:11202015-05-15 07:09:42.034319 [DEBUG] mod_dptools.c:2138 Digit 12015-05-15 07:09:42.034319 [DEBUG] mod_erlang_event.c:157 Sending event DTMF to attached session d7e76764-faf2-11e4-8f50- 771905ed12f62015-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 GetDigitsEXECUTE sofia/test/2001 at 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- 771905ed12f62015-05-15 07:09:49.714345 [NOTICE] switch_cpp.cpp:1291 flush DTMF 22015-05-15 07:09:49.714345 [NOTICE] switch_cpp.cpp:1291 After Get Digits2015-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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150515/150a1dc1/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list