Nicoleta Lazar
2015-05-15 11:55:15 UTC
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/***@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/***@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
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/***@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/***@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