[Freeswitch-users] A DTMF issue

Yungwei Chen yungwei at resolvity.com
Sat Jun 4 02:35:48 MSD 2011


Hi,

When testing the following javascript program, I notice a problem that it takes longer and longer for freeswitch to respond to DTMF input for some reason.
Please refer to http://pastebin.freeswitch.org/16435 for debug logs.
Notice that the difference in time between any adjacent pairs of the following is increasing as time goes by. Am I missing something here? 
	switch_ivr_play_say.c:1279 Codec Activated L16 at 8000hz 1 channels 20ms
	switch_rtp.c:3302 RTP RECV DTMF 2:960
Thanks.

Here's the javascript program:
var dtmf_digits = "";


function on_dtmf_28(session, type, digits, arg)
{
    if (type == "dtmf")
    {

        dtmf_digits = digits.digit;

        console_log("dtmf_digits=" + dtmf_digits + "\n");

        return false; // barge-in / done
    }
    return true;
}

while (true)
{
        dtmf_digits = "";
        session.flushDigits();
        session.streamFile("/usr/local/freeswitch/sounds/long-prompt.wav", on_dtmf_28, false);

        if(dtmf_digits.length == 0)
        {
            /* no input */
            console_log("no input\n");
            session.speak('flite', 'kal', 'no input!', null);
        }
        else if(dtmf_digits == "1" || dtmf_digits == "2")
        {
                console_log("match "+dtmf_digits+"\n");
                session.speak('flite', 'kal', 'you pressed ' + dtmf_digits+ '!', null);
        }
        else
        {
            /* no match */
            console_log("no match\n");
            session.speak('flite', 'kal', "no match!", null);
        }

}



More information about the FreeSWITCH-users mailing list