Hi Brian,<br><br>Please see if you notice anything wrong with the way I pass parameters to playAndGetDigits? I think the failure check works work for "no/empty entry" but not for "invalid entry". <br>
<br>Thanks,<br>Keith<br><br><div class="gmail_quote">On Fri, Oct 24, 2008 at 6:10 PM, Keith Wood <span dir="ltr"><<a href="mailto:keith.wood2000@gmail.com">keith.wood2000@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Brian,<br><br>It is quite strange that I don't get the same result as you do. Here is my lua script:<br>print ("start ivr")<br>digits = session:playAndGetDigits(1, 1, 3, 3000, "#", "/admin_menu.wav",<br>
"/invalid_input.wav","1|2|3|4|5")<br>print("digit="..digits)<br><br>As shown in the log belows, Freeswitch would pompt for 6 times before it fails off. Another problem I am seeing is that after I pressed the "invalid" key for 2 times, Freeswitch would play both admin_menu.wav and invalid_input.wav. For the rest of the cases, Freeswitch plays only invalid_input.wav when an invalid input, such as 9, is entered.<br>
<br>Keith<br><br><br><br>Here is the log:<br><br>2008-10-25 01:53:56 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [test9] destination_number(rule) =~ /(.*)/<br>2008-10-25 01:53:56 [NOTICE] switch_core_session.c:1219 switch_core_session_execute_exten() Execute answer()<br>
2008-10-25 01:53:56 [NOTICE] switch_core_session.c:1219 switch_core_session_execute_exten() Execute lua(testivr.lua)<br><span style="color: rgb(204, 0, 0);">2008-10-25 01:53:56 [DEBUG] switch_ivr_play_say.c:1455 switch_play_and_get_digits() switch_play_and_get_digits(session, 1, 1, 3, 3000, #, /admin_menu.wav, /invalid_input.wav, digit_buffer, 512, 1|2|3|4|5)</span><br>
===Received event=CHANNEL_EXECUTE<br>===Received event=CHANNEL_EXECUTE_COMPLETE<br>===Received event=CHANNEL_EXECUTE<br>2008-10-25 01:53:56 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 30ms<br>
2008-10-25 01:53:56 [DEBUG] switch_core_session.c:435 switch_core_session_receive_message() Kill sofia/internal/<a href="mailto:5454@192.168.1.101" target="_blank">5454@192.168.1.101</a> [BREAK]<br>2008-10-25 01:54:00 [DEBUG] switch_ivr_play_say.c:1218 switch_ivr_play_file() done playing file<br>
2008-10-25 01:54:00 [DEBUG] switch_ivr_play_say.c:1473 switch_play_and_get_digits() play gave up 9<br><span style="color: rgb(204, 0, 0);">2008-10-25 01:54:00 [DEBUG] switch_ivr_play_say.c:1483 switch_play_and_get_digits() Checking regex [1|2|3|4|5] on [9]</span><br>
2008-10-25 01:54:00 [DEBUG] switch_regex.c:198 switch_regex_match() number of matches: -1<br>2008-10-25 01:54:00 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 30ms<br>===Received event=DTMF<br>
===Received event=CODEC<br>2008-10-25 01:54:00 [DEBUG] switch_core_session.c:435 switch_core_session_receive_message() Kill sofia/internal/<a href="mailto:5454@192.168.1.101" target="_blank">5454@192.168.1.101</a> [BREAK]<br>
2008-10-25 01:54:04 [DEBUG] switch_ivr_play_say.c:1218 switch_ivr_play_file() done playing file<br>
2008-10-25 01:54:04 [DEBUG] switch_ivr_play_say.c:1507 switch_play_and_get_digits() Calling more digits try 3<br>===Received event=CODEC<br><span style="color: rgb(204, 0, 0);">2008-10-25 01:54:05 [DEBUG] switch_ivr_play_say.c:1524 switch_play_and_get_digits() Checking regex [1|2|3|4|5] on [99]</span><br>
2008-10-25 01:54:05 [DEBUG] switch_regex.c:198 switch_regex_match() number of matches: -1<br>2008-10-25 01:54:05 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 30ms<br>2008-10-25 01:54:05 [DEBUG] switch_core_session.c:435 switch_core_session_receive_message() Kill sofia/internal/<a href="mailto:5454@192.168.1.101" target="_blank">5454@192.168.1.101</a> [BREAK]<br>
===Received event=DTMF<br>2008-10-25 01:54:09 [DEBUG] switch_ivr_play_say.c:1218 switch_ivr_play_file() done playing file<br>===Received event=CODEC<br>2008-10-25 01:54:09 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 30ms<br>
2008-10-25 01:54:09 [DEBUG] switch_core_session.c:435 switch_core_session_receive_message() Kill sofia/internal/<a href="mailto:5454@192.168.1.101" target="_blank">5454@192.168.1.101</a> [BREAK]<br>===Received event=HEARTBEAT<br>
===Received event=RE_SCHEDULE<br>
2008-10-25 01:54:12 [DEBUG] switch_ivr_play_say.c:1218 switch_ivr_play_file() done playing file<br>2008-10-25 01:54:12 [DEBUG] switch_ivr_play_say.c:1473 switch_play_and_get_digits() play gave up 9<br><span style="color: rgb(204, 0, 0);">2008-10-25 01:54:12 [DEBUG] switch_ivr_play_say.c:1483 switch_play_and_get_digits() Checking regex [1|2|3|4|5] on [9]</span><br>
2008-10-25 01:54:12 [DEBUG] switch_regex.c:198 switch_regex_match() number of matches: -1<br>2008-10-25 01:54:12 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 30ms<br>2008-10-25 01:54:12 [DEBUG] switch_core_session.c:435 switch_core_session_receive_message() Kill sofia/internal/<a href="mailto:5454@192.168.1.101" target="_blank">5454@192.168.1.101</a> [BREAK]<br>
===Received event=DTMF<br>===Received event=CODEC<br>2008-10-25 01:54:16 [DEBUG] switch_ivr_play_say.c:1218 switch_ivr_play_file() done playing file<br>2008-10-25 01:54:16 [DEBUG] switch_ivr_play_say.c:1507 switch_play_and_get_digits() Calling more digits try 2<br>
===Received event=CODEC<br><span style="color: rgb(204, 0, 0);">2008-10-25 01:54:19 [DEBUG] switch_ivr_play_say.c:1524 switch_play_and_get_digits() Checking regex [1|2|3|4|5] on [99]</span><br>2008-10-25 01:54:19 [DEBUG] switch_regex.c:198 switch_regex_match() number of matches: -1<br>
2008-10-25 01:54:19 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 30ms<br>2008-10-25 01:54:19 [DEBUG] switch_core_session.c:435 switch_core_session_receive_message() Kill sofia/internal/<a href="mailto:5454@192.168.1.101" target="_blank">5454@192.168.1.101</a> [BREAK]<br>
===Received event=DTMF<br>2008-10-25 01:54:23 [DEBUG] switch_ivr_play_say.c:1218 switch_ivr_play_file() done playing file<br>2008-10-25 01:54:23 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 30ms<br>
2008-10-25 01:54:23 [DEBUG] switch_core_session.c:435 switch_core_session_receive_message() Kill sofia/internal/<a href="mailto:5454@192.168.1.101" target="_blank">5454@192.168.1.101</a> [BREAK]<br>===Received event=CODEC<br>
2008-10-25 01:54:26 [DEBUG] switch_ivr_play_say.c:1218 switch_ivr_play_file() done playing file<br>
2008-10-25 01:54:26 [DEBUG] switch_ivr_play_say.c:1473 switch_play_and_get_digits() play gave up 9<br><span style="color: rgb(204, 0, 0);">2008-10-25 01:54:26 [DEBUG] switch_ivr_play_say.c:1483 switch_play_and_get_digits() Checking regex [1|2|3|4|5] on [9]</span><br>
2008-10-25 01:54:26 [DEBUG] switch_regex.c:198 switch_regex_match() number of matches: -1<br>2008-10-25 01:54:26 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 30ms<br>2008-10-25 01:54:26 [DEBUG] switch_core_session.c:435 switch_core_session_receive_message() Kill sofia/internal/<a href="mailto:5454@192.168.1.101" target="_blank">5454@192.168.1.101</a> [BREAK]<br>
===Received event=DTMF<br>===Received event=CODEC<br>2008-10-25 01:54:27 [DEBUG] sofia.c:200 sofia_event_callback() event [nua_i_outbound] status [102][NAT binding changed] session: n/a<br>2008-10-25 01:54:27 [DEBUG] sofia.c:332 sofia_event_callback() nua_i_outbound: unknown event 8: 102 NAT binding changed<br>
2008-10-25 01:54:28 [DEBUG] sofia_reg.c:121 sofia_reg_check_gateway() registered nine<br>2008-10-25 01:54:30 [DEBUG] switch_ivr_play_say.c:1218 switch_ivr_play_file() done playing file<br>2008-10-25 01:54:30 [DEBUG] switch_ivr_play_say.c:1507 switch_play_and_get_digits() Calling more digits try 1<br>
===Received event=CODEC<br>===Received event=HEARTBEAT<br>===Received event=RE_SCHEDULE<br><span style="color: rgb(204, 0, 0);">2008-10-25 01:54:31 [DEBUG] switch_ivr_play_say.c:1524 switch_play_and_get_digits() Checking regex [1|2|3|4|5] on [99]</span><br>
2008-10-25 01:54:31 [DEBUG] switch_regex.c:198 switch_regex_match() number of matches: -1<br>2008-10-25 01:54:31 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 30ms<br>2008-10-25 01:54:31 [DEBUG] switch_core_session.c:435 switch_core_session_receive_message() Kill sofia/internal/<a href="mailto:5454@192.168.1.101" target="_blank">5454@192.168.1.101</a> [BREAK]<br>
===Received event=DTMF<br>digit=99<br>2008-10-25 01:54:36 [DEBUG] switch_ivr_play_say.c:1218 switch_ivr_play_file() done playing file<br>2008-10-25 01:54:36 [DEBUG] switch_cpp.cpp:738 playAndGetDigits() playAndGetDigits dtmf_buf: 99<div>
<div></div><div class="Wj3C7c"><br>
<br><br><br><br><br>On Tue, Oct 21, 2008 at 2:04 AM, Brian West <<a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a>> wrote:<br><br> Keith,<br> I tried something like this and it worked fine.<br>
<br>
digits = session:playAndGetDigits(1, 1, 3, 3000, "#*", "/tmp/sr8k.wav", "/tmp/test.wav", "1|2|3|5")<br><br> Can you verify this?<br><br> /b<br><br> On Oct 18, 2008, at 4:14 AM, Keith Wood wrote:<br>
<br>> Hi Brian,<br>><br>> Here is the script:<br>><br>> digits = session:playAndGetDigits(1, 1, 3, 3000, #*, /audio/admin_menu.wav , /audio/invalid_input.wav ,1|2|3|5 )<br>><br>> I basically copied from the wiki.<br>
><br>> Thanks,<br>> Keith<br><br><br></div></div><div><div></div><div class="Wj3C7c"> _______________________________________________<br> Freeswitch-users mailing list<br> <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><br><br>
</div></div></blockquote></div><br>