[Freeswitch-users] significant delay waiting for response after playAndGetDigits()
Wes
wes-fs at 499x.com
Fri Jul 1 01:33:39 MSD 2011
BTW, I rewrote the test script using sayPhrase along with an input
callback to break out when the user presses a key, and the exact same
behavior happens, here's the script:
local numberToCall = argv[1];
invalid = "ivr/ivr-that_was_an_invalid_entry.wav"
local session =
freeswitch.Session("{ignore_early_media=true,origination_caller_id_name='MCW
Phone
Transcription',origination_caller_id_number=2580}sofia/gateway/mcw/"..numberToCall);
function key_press(session, input_type, data, args)
if input_type == "dtmf" then
freeswitch.consoleLog("info", "Key pressed: " .. data["digit"].."\n")
return "break"
end
end
if session:ready() then
session:answer()
session:set_tts_parms("flite", "awb");
session:setInputCallback("key_press", "")
session:sayPhrase("count_to_ten", "", "en")
session:speak("you pressed a digit");
freeswitch.consoleLog("info", "the user pressed a key\n");
session:sayPhrase("count_to_ten", "", "en")
session:speak("you pressed a digit");
freeswitch.consoleLog("info", "the user pressed a key\n");
session:sayPhrase("count_to_ten", "", "en")
session:speak("you pressed a digit");
freeswitch.consoleLog("info", "the user pressed a key\n");
session:sayPhrase("count_to_ten", "", "en")
session:speak("you pressed a digit");
freeswitch.consoleLog("info", "the user pressed a key\n");
session:sayPhrase("count_to_ten", "", "en")
session:speak("you pressed a digit");
freeswitch.consoleLog("info", "the user pressed a key\n");
session:sayPhrase("count_to_ten", "", "en")
session:speak("you pressed a digit");
freeswitch.consoleLog("info", "the user pressed a key\n");
end
On 6/30/2011 2:01 PM, Wes wrote:
> I'm in fs_cli, and I think the loglevel is already at debug, since I set
> it to debug and saw the same messages that I have in the pastebin
>
> http://pastebin.freeswitch.org/16635
>
> in line 12, you can see that it received DTMF 1 right after speaking "One"
>
> but then, the second time I called pagd, you can see that in line 39, it got as far as speaking the number "Three"
> And, the third time, in line 81, it gets to speaking "Six", before detecting the DTMF.
>
> So, is that what you mean by monitoring the DTMF? Even though I press the number immediately when the message says "go", it takes longer and longer each time to respond.
>
>
> On 6/30/2011 1:50 PM, Anthony Minessale wrote:
>> have you monitored your dtmf ?
>> is it 2833?
>>
>> Try console loglevel debug and look at the message saying when you got the dtmf.
>>
>>
>> On Thu, Jun 30, 2011 at 1:46 PM, Wes<wes-fs at 499x.com> wrote:
>>> I've narrowed it down a bit. I think this may be a bug (memory leak maybe?)
>>>
>>> It seems that the pagd function is very responsive on the first use, but
>>> on each repeated call to this function, it takes longer to respond to
>>> the user's keypress.
>>>
>>> The following test script illustrates the problem. It asks user to
>>> press a key, then it starts counting up to 10. The first time, it stops
>>> right away after you press a key, telling you what key you pressed, the
>>> second time, it gets as far as the number 3, the third time, it counts
>>> up to six, and so on, until it completes the count all the way to 10,
>>> and then it says you've pressed an invalid entry, even though you indeed
>>> pressed a key at the beginning of the message.
>>>
>>> lua script:
>>> http://pastebin.freeswitch.org/16637
>>>
>>> phrase xml:
>>> http://pastebin.freeswitch.org/16636
>>>
>>> Log:
>>> http://pastebin.freeswitch.org/16635
>>>
>>> Could someone try this example on their own system to see if they could
>>> duplicate the behavior?
>>>
>>> Thanks in advance!
>>>
>>>
>>> On 6/30/2011 10:10 AM, Wes wrote:
>>>> I am experiencing a delay waiting for the system to respond in a lua
>>>> script that is using playAndGetDigits. I press a key while the voice is
>>>> still speaking, and it continues to speak for a few seconds before
>>>> moving to the part of the script for the particular keypress.
>>>>
>>>> Also, related: sometimes it speaks the "invalid" message even though the
>>>> key pressed is a valid one, and then immediately after speaking the
>>>> invalid message, it continues with the processing for the key that was
>>>> pressed. So I know I didn't press an invalid key.
>>>>
>>>> -- session:execute('flush_dtmf');
>>>> session:flushDigits()
>>>> local digits = session:playAndGetDigits(1, 1, 3, 2000, "#",
>>>> "phrase:play_submit_rerecord:1:2:3", invalid, "\\d{1}")
>>>> if ( digits == "1") then
>>>>
>>>> ETC
>>>>
>>>> here is the phrase:
>>>>
>>>> <macro name="play_submit_rerecord">
>>>> <input pattern="^([0-9#*]):([0-9#*]):([0-9#*])$">
>>>> <match>
>>>> <action function="speak-text"
>>>> data="To listen to your dictation, press $1, To submit
>>>> your dictation , press $2, To discard your dictation and start over,
>>>> press $3."/>
>>>> </match>
>>>> </input>
>>>> </macro>
>>>>
>>>> Is the speak-text just too cpu intensive and causing it to be slow to
>>>> respond to the DTMF?
>>>>
>>>> Any help would be appreciated... thanks!
>>>>
>>>> _______________________________________________
>>>> Join us at ClueCon 2011, Aug 9-11, Chicago
>>>> http://www.cluecon.com 877-7-4ACLUE
>>>>
>>>> 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
>>> _______________________________________________
>>> Join us at ClueCon 2011, Aug 9-11, Chicago
>>> http://www.cluecon.com 877-7-4ACLUE
>>>
>>> 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
>>>
>>
> _______________________________________________
> Join us at ClueCon 2011, Aug 9-11, Chicago
> http://www.cluecon.com 877-7-4ACLUE
>
> 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
More information about the FreeSWITCH-users
mailing list