Hello,
When I just use the "<action application="lua" data="test.lua"/>" the call goes through and sends the correct DTMF from the channel variable passed which is 1002. When I uncomment the "<action application="set" data="execute_on_answer=lua test.lua"/>" and comment out the other line, then do a reloadxml on fs. The DTMF is not passed correctly and the call fails. I have stripped down my test.lua script to just basic to only play a file and it still fails. In this scenario I am testing calling from the freeswitch box to another freeswitch IVR, but this should work regardless of what IVR it calls. Below is the output of the both boxes.
--------------xml----------------------
<include>
<extension name="test_ivr">
<condition field="destination_number" expression="^9176$">
<action application="answer"/>
<action application="sleep" data="2000"/>
<!-- <action application="send_dtmf" data="${ext}"/> -->
<action application="sleep" data="1000"/>
<!-- <action application="lua" data="test.lua"/> -->
<action application="set" data="execute_on_answer=lua test.lua"/>
</condition>
</extension>
</include>
--------------xml----------------------
--------------test.lua----------------------
#!/bin/lua
soundDir = "/etc/freeswitch/scripts/sounds/"
welcome = soundDir .. "welcome.wav"
freeswitch.consoleLog("INFO", "got here\n")
--Starts Playing welcome message and accepts digits
value = session:playAndGetDigits(2, 4, 3, 3000, "#", welcome, "", "\\d+")
freeswitch.consoleLog("INFO", "got digits " ..value.. "\n")
--------------test.lua----------------------
--------------this FS box----------------------
Dialplan: sofia/external/1112223333 Regex (PASS) [test_ivr] destination_number(9176) =~ /^9176$/ break=on-false
Dialplan: sofia/external/1112223333 Action sleep(2000)
Dialplan: sofia/external/1112223333 Action send_dtmf(1002)
Dialplan: sofia/external/1112223333 Action sleep(1000)
Dialplan: sofia/external/1112223333 Action set(execute_on_answer=lua test.lua)
2019-04-26 17:52:22.511865 [INFO] switch_channel.c:3129 sofia/external/1112223333 Flipping CID from "" <3337777777> to "Outbound Call" <>
2019-04-26 17:52:22.511865 [DEBUG] switch_core_state_machine.c:286 (sofia/external/1112223333) State Change CS_ROUTING -> CS_EXECUTE
2019-04-26 17:52:22.511865 [DEBUG] switch_core_state_machine.c:643 (sofia/external/1112223333) State ROUTING going to sleep
2019-04-26 17:52:22.511865 [DEBUG] switch_core_state_machine.c:584 (sofia/external/1112223333) Running State Change CS_EXECUTE (Cur 1 To)
2019-04-26 17:52:22.511865 [DEBUG] switch_core_state_machine.c:650 (sofia/external/1112223333) State EXECUTE
2019-04-26 17:52:22.511865 [DEBUG] mod_sofia.c:198 sofia/external/1112223333 SOFIA EXECUTE
2019-04-26 17:52:22.511865 [DEBUG] switch_core_state_machine.c:328 sofia/external/1112223333 Standard EXECUTE
EXECUTE sofia/external/1112223333 set(open=true)
2019-04-26 17:52:22.511865 [DEBUG] mod_dptools.c:1548 SET sofia/external/1112223333 [open]=[true]
EXECUTE sofia/external/1112223333 sleep(2000)
EXECUTE sofia/external/1112223333 send_dtmf(1002)
2019-04-26 17:52:24.511881 [DEBUG] switch_core_io.c:1894 sofia/external/1112223333 send dtmf
digit=1 ms=250 samples=2000
2019-04-26 17:52:24.511881 [DEBUG] switch_core_io.c:1894 sofia/external/1112223333 send dtmf
digit=0 ms=250 samples=2000
2019-04-26 17:52:24.511881 [DEBUG] switch_core_io.c:1894 sofia/external/1112223333 send dtmf
digit=0 ms=250 samples=2000
2019-04-26 17:52:24.511881 [DEBUG] switch_core_io.c:1894 sofia/external/1112223333 send dtmf
digit=2 ms=250 samples=2000
EXECUTE sofia/external/1112223333 sleep(1000)
2019-04-26 17:52:24.531872 [DEBUG] switch_rtp.c:5261 Send start packet for [1] ts=160 dur=160/160/2000 seq=16436 lw=160
2019-04-26 17:52:24.531872 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=320/320/2000 seq=16437 lw=320
2019-04-26 17:52:24.551861 [DEBUG] switch_rtp.c:7308 Correct audio ip/port confirmed.
2019-04-26 17:52:24.551861 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=480/480/2000 seq=16438 lw=480
2019-04-26 17:52:24.571862 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=640/640/2000 seq=16439 lw=640
2019-04-26 17:52:24.591872 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=800/800/2000 seq=16440 lw=800
2019-04-26 17:52:24.611866 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=960/960/2000 seq=16441 lw=960
2019-04-26 17:52:24.631863 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=1120/1120/2000 seq=16442 lw=1120
2019-04-26 17:52:24.651858 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=1280/1280/2000 seq=16443 lw=1280
2019-04-26 17:52:24.671867 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=1440/1440/2000 seq=16444 lw=1440
2019-04-26 17:52:24.691863 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=1600/1600/2000 seq=16445 lw=1600
2019-04-26 17:52:24.711874 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=1760/1760/2000 seq=16446 lw=1760
2019-04-26 17:52:24.731866 [DEBUG] switch_rtp.c:5160 Send middle packet for [1] ts=160 dur=1920/1920/2000 seq=16447 lw=1920
2019-04-26 17:52:24.751872 [DEBUG] switch_rtp.c:5160 Send end packet for [1] ts=160 dur=2080/2080/2000 seq=16448 lw=1920
2019-04-26 17:52:24.751872 [DEBUG] switch_rtp.c:5160 Send end packet for [1] ts=160 dur=2080/2080/2000 seq=16449 lw=1920
2019-04-26 17:52:24.751872 [DEBUG] switch_rtp.c:5160 Send end packet for [1] ts=160 dur=2080/2080/2000 seq=16450 lw=1920
2019-04-26 17:52:24.751872 [DEBUG] switch_rtp.c:5108 Queue digit delay of 40ms
2019-04-26 17:52:25.151870 [DEBUG] switch_rtp.c:5261 Send start packet for [0] ts=2400 dur=160/160/2000 seq=16451 lw=2400
2019-04-26 17:52:25.171870 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=320/320/2000 seq=16452 lw=2560
2019-04-26 17:52:25.191863 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=480/480/2000 seq=16453 lw=2720
2019-04-26 17:52:25.211881 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=640/640/2000 seq=16454 lw=2880
2019-04-26 17:52:25.231878 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=800/800/2000 seq=16455 lw=3040
2019-04-26 17:52:25.251862 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=960/960/2000 seq=16456 lw=3200
2019-04-26 17:52:25.271866 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=1120/1120/2000 seq=16457 lw=3360
2019-04-26 17:52:25.291874 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=1280/1280/2000 seq=16458 lw=3520
2019-04-26 17:52:25.311871 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=1440/1440/2000 seq=16459 lw=3680
2019-04-26 17:52:25.331864 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=1600/1600/2000 seq=16460 lw=3840
2019-04-26 17:52:25.351866 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=1760/1760/2000 seq=16461 lw=4000
2019-04-26 17:52:25.371873 [DEBUG] switch_rtp.c:5160 Send middle packet for [0] ts=2400 dur=1920/1920/2000 seq=16462 lw=4160
2019-04-26 17:52:25.391864 [DEBUG] switch_rtp.c:5160 Send end packet for [0] ts=2400 dur=2080/2080/2000 seq=16463 lw=4160
2019-04-26 17:52:25.391864 [DEBUG] switch_rtp.c:5160 Send end packet for [0] ts=2400 dur=2080/2080/2000 seq=16464 lw=4160
2019-04-26 17:52:25.391864 [DEBUG] switch_rtp.c:5160 Send end packet for [0] ts=2400 dur=2080/2080/2000 seq=16465 lw=4160
2019-04-26 17:52:25.391864 [DEBUG] switch_rtp.c:5108 Queue digit delay of 40ms
EXECUTE sofia/external/1112223333 set(execute_on_answer=lua test.lua)
2019-04-26 17:52:25.531882 [DEBUG] mod_dptools.c:1548 SET sofia/external/1112223333 [execute_on_answer]=[lua test.lua]
2019-04-26 17:52:25.531882 [NOTICE] switch_core_state_machine.c:385 sofia/external/1112223333 has executed the last dialplan instruction.
2019-04-26 17:52:25.531882 [NOTICE] switch_core_state_machine.c:387 Hangup sofia/external/1112223333 [CS_EXECUTE] [NORMAL_CLEARING]
--------------this FS box----------------------
--------------receiving FS box----------------------2019-04-26 20:53:34.216925 [NOTICE] mod_dptools.c:1312 Channel [sofia/internal/+
13337777777@10.21.10.4] has been answered
2019-04-26 20:53:34.216925 [DEBUG] switch_channel.c:3773 (sofia/internal/+
13337777777@10.21.10.4) Callstate Change RINGING -> ACTIVE
2019-04-26 20:53:34.636985 [DEBUG] switch_rtp.c:7308 Correct audio ip/port confirmed.
2019-04-26 20:53:34.676971 [DEBUG] sofia.c:7084 Channel sofia/internal/+
13337777777@10.21.10.4 entering state [ready][200]
2019-04-26 20:53:35.216977 [DEBUG] mod_dptools.c:1548 SET sofia/internal/+
13337777777@10.21.10.4 [hangup_after_bridge]=[true]
2019-04-26 20:53:35.216977 [DEBUG] mod_dptools.c:1548 SET sofia/internal/+
13337777777@10.21.10.4 [ringback]=[local_stream://default]
2019-04-26 20:53:35.216977 [DEBUG] mod_dptools.c:1548 SET sofia/internal/+
13337777777@10.21.10.4 [transfer_ringback]=[local_stream://default]
2019-04-26 20:53:35.216977 [DEBUG] mod_dptools.c:1548 SET sofia/internal/+
13337777777@10.21.10.4 [ivr_menu_uuid]=[d67bb786-a0bc-4094-91fa-76f7db68caeb]
2019-04-26 20:53:35.236936 [DEBUG] freeswitch_lua.cpp:365 DBH handle 0x7f3c6005cdf0 Connected.
2019-04-26 20:53:35.236936 [DEBUG] freeswitch_lua.cpp:382 DBH handle 0x7f3c6005cdf0 released.
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-exit'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-sub'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-exec-app'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-play-sound'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-back'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-top'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:880 building menu 'd67bb786-a0bc-4094-91fa-76f7db68caeb'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:964 binding menu action 'menu-exec-app' to '1'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:964 binding menu action 'menu-exec-app' to '/^(\d{2,11})$/'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:964 binding menu action 'menu-exec-app' to '/^(\d{2,11})$/'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:964 binding menu action 'menu-exec-app' to '/^(\d{2,11})$/'
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_menu.c:483 Executing IVR menu d67bb786-a0bc-4094-91fa-76f7db68caeb
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_play_say.c:3025 OPEN TTS flite
2019-04-26 20:53:35.236936 [DEBUG] switch_ivr_play_say.c:3035 Raw Codec Activated
2019-04-26 20:53:35.376916 [DEBUG] switch_ivr_play_say.c:2729 Speaking text: Hello World, This is a test IVR
2019-04-26 20:53:37.236985 [DEBUG] switch_rtp.c:7534 RTP RECV DTMF 1:2080
2019-04-26 20:53:37.236985 [INFO] switch_channel.c:515 RECV DTMF 1:2080
2019-04-26 20:53:37.236985 [DEBUG] switch_ivr_play_say.c:2907 done speaking text
2019-04-26 20:53:37.236985 [DEBUG] switch_ivr_menu.c:377 waiting for 3/4 digits t/o 2000
2019-04-26 20:53:37.876935 [DEBUG] switch_rtp.c:7534 RTP RECV DTMF 0:2080
2019-04-26 20:53:37.876935 [INFO] switch_channel.c:515 RECV DTMF 0:2080
2019-04-26 20:53:37.896923 [NOTICE] sofia.c:1012 Hangup sofia/internal/+
13337777777@10.21.10.4 [CS_EXECUTE] [NORMAL_CLEARING]
--------------receiving FS box----------------------