Hi Brian,<br><br>Please see if you notice anything wrong with the way I pass parameters to playAndGetDigits?&nbsp; I think the failure check works work for &quot;no/empty entry&quot; but not for &quot;invalid entry&quot;.&nbsp; <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">&lt;<a href="mailto:keith.wood2000@gmail.com">keith.wood2000@gmail.com</a>&gt;</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&#39;t get the same result as you do. Here is my lua script:<br>print (&quot;start ivr&quot;)<br>digits = session:playAndGetDigits(1, 1, 3, 3000, &quot;#&quot;, &quot;/admin_menu.wav&quot;,<br>

&quot;/invalid_input.wav&quot;,&quot;1|2|3|4|5&quot;)<br>print(&quot;digit=&quot;..digits)<br><br>As shown in the log belows, Freeswitch would pompt for 6 times before it fails off.&nbsp; Another problem I am seeing is that after I pressed the &quot;invalid&quot; key for 2 times, Freeswitch would play both admin_menu.wav and invalid_input.wav.&nbsp; 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 &lt;<a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a>&gt; wrote:<br><br>&nbsp;&nbsp;&nbsp; Keith,<br>&nbsp;&nbsp;&nbsp; I tried something like this and it worked fine.<br>
<br>
&nbsp;&nbsp;&nbsp; digits = session:playAndGetDigits(1, 1, 3, 3000, &quot;#*&quot;, &quot;/tmp/sr8k.wav&quot;, &quot;/tmp/test.wav&quot;, &quot;1|2|3|5&quot;)<br><br>&nbsp;&nbsp;&nbsp; Can you verify this?<br><br>&nbsp;&nbsp;&nbsp; /b<br><br>&nbsp;&nbsp;&nbsp; On Oct 18, 2008, at 4:14 AM, Keith Wood wrote:<br>

<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Hi Brian,<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Here is the script:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; digits = session:playAndGetDigits(1, 1, 3, 3000, #*, /audio/admin_menu.wav , /audio/invalid_input.wav ,1|2|3|5 )<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I basically copied from the wiki.<br>

&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Thanks,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Keith<br><br><br></div></div><div><div></div><div class="Wj3C7c">&nbsp;&nbsp;&nbsp; _______________________________________________<br>&nbsp;&nbsp;&nbsp; Freeswitch-users mailing list<br>&nbsp;&nbsp;&nbsp; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>

&nbsp;&nbsp;&nbsp; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>&nbsp;&nbsp;&nbsp; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>

&nbsp;&nbsp;&nbsp; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><br><br>
</div></div></blockquote></div><br>