[Freeswitch-users] Problem with PlayAndGetDigits
Keith Wood
keith.wood2000 at gmail.com
Fri Oct 24 06:10:54 EDT 2008
Hi Brian,
It is quite strange that I don't get the same result as you do. Here is my
lua script:
print ("start ivr")
digits = session:playAndGetDigits(1, 1, 3, 3000, "#", "/admin_menu.wav",
"/invalid_input.wav","1|2|3|4|5")
print("digit="..digits)
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.
Keith
Here is the log:
2008-10-25 01:53:56 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex:
[test9] destination_number(rule) =~ /(.*)/
2008-10-25 01:53:56 [NOTICE] switch_core_session.c:1219
switch_core_session_execute_exten() Execute answer()
2008-10-25 01:53:56 [NOTICE] switch_core_session.c:1219
switch_core_session_execute_exten() Execute lua(testivr.lua)
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)
===Received event=CHANNEL_EXECUTE
===Received event=CHANNEL_EXECUTE_COMPLETE
===Received event=CHANNEL_EXECUTE
2008-10-25 01:53:56 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file()
Codec Activated L16 at 8000hz 1 channels 30ms
2008-10-25 01:53:56 [DEBUG] switch_core_session.c:435
switch_core_session_receive_message() Kill
sofia/internal/5454 at 192.168.1.101[BREAK]
2008-10-25 01:54:00 [DEBUG] switch_ivr_play_say.c:1218
switch_ivr_play_file() done playing file
2008-10-25 01:54:00 [DEBUG] switch_ivr_play_say.c:1473
switch_play_and_get_digits() play gave up 9
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]
2008-10-25 01:54:00 [DEBUG] switch_regex.c:198 switch_regex_match() number
of matches: -1
2008-10-25 01:54:00 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file()
Codec Activated L16 at 8000hz 1 channels 30ms
===Received event=DTMF
===Received event=CODEC
2008-10-25 01:54:00 [DEBUG] switch_core_session.c:435
switch_core_session_receive_message() Kill
sofia/internal/5454 at 192.168.1.101[BREAK]
2008-10-25 01:54:04 [DEBUG] switch_ivr_play_say.c:1218
switch_ivr_play_file() done playing file
2008-10-25 01:54:04 [DEBUG] switch_ivr_play_say.c:1507
switch_play_and_get_digits() Calling more digits try 3
===Received event=CODEC
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]
2008-10-25 01:54:05 [DEBUG] switch_regex.c:198 switch_regex_match() number
of matches: -1
2008-10-25 01:54:05 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file()
Codec Activated L16 at 8000hz 1 channels 30ms
2008-10-25 01:54:05 [DEBUG] switch_core_session.c:435
switch_core_session_receive_message() Kill
sofia/internal/5454 at 192.168.1.101[BREAK]
===Received event=DTMF
2008-10-25 01:54:09 [DEBUG] switch_ivr_play_say.c:1218
switch_ivr_play_file() done playing file
===Received event=CODEC
2008-10-25 01:54:09 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file()
Codec Activated L16 at 8000hz 1 channels 30ms
2008-10-25 01:54:09 [DEBUG] switch_core_session.c:435
switch_core_session_receive_message() Kill
sofia/internal/5454 at 192.168.1.101[BREAK]
===Received event=HEARTBEAT
===Received event=RE_SCHEDULE
2008-10-25 01:54:12 [DEBUG] switch_ivr_play_say.c:1218
switch_ivr_play_file() done playing file
2008-10-25 01:54:12 [DEBUG] switch_ivr_play_say.c:1473
switch_play_and_get_digits() play gave up 9
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]
2008-10-25 01:54:12 [DEBUG] switch_regex.c:198 switch_regex_match() number
of matches: -1
2008-10-25 01:54:12 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file()
Codec Activated L16 at 8000hz 1 channels 30ms
2008-10-25 01:54:12 [DEBUG] switch_core_session.c:435
switch_core_session_receive_message() Kill
sofia/internal/5454 at 192.168.1.101[BREAK]
===Received event=DTMF
===Received event=CODEC
2008-10-25 01:54:16 [DEBUG] switch_ivr_play_say.c:1218
switch_ivr_play_file() done playing file
2008-10-25 01:54:16 [DEBUG] switch_ivr_play_say.c:1507
switch_play_and_get_digits() Calling more digits try 2
===Received event=CODEC
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]
2008-10-25 01:54:19 [DEBUG] switch_regex.c:198 switch_regex_match() number
of matches: -1
2008-10-25 01:54:19 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file()
Codec Activated L16 at 8000hz 1 channels 30ms
2008-10-25 01:54:19 [DEBUG] switch_core_session.c:435
switch_core_session_receive_message() Kill
sofia/internal/5454 at 192.168.1.101[BREAK]
===Received event=DTMF
2008-10-25 01:54:23 [DEBUG] switch_ivr_play_say.c:1218
switch_ivr_play_file() done playing file
2008-10-25 01:54:23 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file()
Codec Activated L16 at 8000hz 1 channels 30ms
2008-10-25 01:54:23 [DEBUG] switch_core_session.c:435
switch_core_session_receive_message() Kill
sofia/internal/5454 at 192.168.1.101[BREAK]
===Received event=CODEC
2008-10-25 01:54:26 [DEBUG] switch_ivr_play_say.c:1218
switch_ivr_play_file() done playing file
2008-10-25 01:54:26 [DEBUG] switch_ivr_play_say.c:1473
switch_play_and_get_digits() play gave up 9
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]
2008-10-25 01:54:26 [DEBUG] switch_regex.c:198 switch_regex_match() number
of matches: -1
2008-10-25 01:54:26 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file()
Codec Activated L16 at 8000hz 1 channels 30ms
2008-10-25 01:54:26 [DEBUG] switch_core_session.c:435
switch_core_session_receive_message() Kill
sofia/internal/5454 at 192.168.1.101[BREAK]
===Received event=DTMF
===Received event=CODEC
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
2008-10-25 01:54:27 [DEBUG] sofia.c:332 sofia_event_callback()
nua_i_outbound: unknown event 8: 102 NAT binding changed
2008-10-25 01:54:28 [DEBUG] sofia_reg.c:121 sofia_reg_check_gateway()
registered nine
2008-10-25 01:54:30 [DEBUG] switch_ivr_play_say.c:1218
switch_ivr_play_file() done playing file
2008-10-25 01:54:30 [DEBUG] switch_ivr_play_say.c:1507
switch_play_and_get_digits() Calling more digits try 1
===Received event=CODEC
===Received event=HEARTBEAT
===Received event=RE_SCHEDULE
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]
2008-10-25 01:54:31 [DEBUG] switch_regex.c:198 switch_regex_match() number
of matches: -1
2008-10-25 01:54:31 [DEBUG] switch_ivr_play_say.c:928 switch_ivr_play_file()
Codec Activated L16 at 8000hz 1 channels 30ms
2008-10-25 01:54:31 [DEBUG] switch_core_session.c:435
switch_core_session_receive_message() Kill
sofia/internal/5454 at 192.168.1.101[BREAK]
===Received event=DTMF
digit=99
2008-10-25 01:54:36 [DEBUG] switch_ivr_play_say.c:1218
switch_ivr_play_file() done playing file
2008-10-25 01:54:36 [DEBUG] switch_cpp.cpp:738 playAndGetDigits()
playAndGetDigits dtmf_buf: 99
On Tue, Oct 21, 2008 at 2:04 AM, Brian West <brian at freeswitch.org> wrote:
Keith,
I tried something like this and it worked fine.
digits = session:playAndGetDigits(1, 1, 3, 3000, "#*", "/tmp/sr8k.wav",
"/tmp/test.wav", "1|2|3|5")
Can you verify this?
/b
On Oct 18, 2008, at 4:14 AM, Keith Wood wrote:
> Hi Brian,
>
> Here is the script:
>
> digits = session:playAndGetDigits(1, 1, 3, 3000, #*,
/audio/admin_menu.wav , /audio/invalid_input.wav ,1|2|3|5 )
>
> I basically copied from the wiki.
>
> Thanks,
> Keith
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20081024/d32391bd/attachment-0001.html
More information about the Freeswitch-users
mailing list