[Freeswitch-users] problem with "play_and_get_digits" command (DTMF delay time)

Manish Talwar manish.talwar at nexxuspg.com
Mon Aug 31 14:34:30 MSD 2015


Hi Michael,


Thanks for your help.


Its working fine now with setting the value of "bind_digit_digit_timeout" and "bind_digit_input_timeout" channel variable. I have set it as 10000 and its wait till 10 sec now for matching the regular expression.


<execute application="set" data="bind_digit_digit_timeout=10000" />

<execute application="set" data="bind_digit_input_timeout=10000" />


Its working fine with me, your docs team can document this if required.


Thanks,


Regards,

Manish Talwar


________________________________
From: freeswitch-users-bounces at lists.freeswitch.org <freeswitch-users-bounces at lists.freeswitch.org> on behalf of Michael Collins <msc at freeswitch.org>
Sent: 28 August 2015 23:15
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] problem with "play_and_get_digits" command (DTMF delay time)

I found this in mod_dptools.c inside the bind_to_session function:

    if (!(dmachine = switch_core_session_get_dmachine(session, target))) {
        uint32_t digit_timeout = 1500;
        uint32_t input_timeout = 0;
        const char *var;

        if ((var = switch_channel_get_variable(channel, "bind_digit_digit_timeout"))) {
            digit_timeout = switch_atoul(var);
        }

        if ((var = switch_channel_get_variable(channel, "bind_digit_input_timeout"))) {
            input_timeout = switch_atoul(var);
        }

        switch_ivr_dmachine_create(&dmachine, "DPTOOLS", NULL, digit_timeout, input_timeout, NULL, digit_nomatch_action_callback, session);
        switch_core_session_set_dmachine(session, dmachine, target);
    }


It appears that there might be two channel variables for you to try:
bind_digit_digit_timeout
bind_digit_input_timeout

These appear not to be documented at present, so I think you can help pay it forward by tinkering with them and then reporting back what you find out. As a guess, I'd say you're running into an issue with people who spend more than 1.5 seconds between digits. (It appears the default is 1500ms.) Try setting the bind_digit_digit_timeout value in the dialplan. Set it to something absurdly long like 7500 so that you can know for sure it is working.

Please report back with your findings so that the docs team can document this. Bonus points if you document it yourself. :)

Hope this helps,
Michael



On Wed, Aug 26, 2015 at 10:16 PM, Manish Talwar <manish.talwar at nexxuspg.com<mailto:manish.talwar at nexxuspg.com>> wrote:

Hi,


Thank you for your response.


Actually, we are using multiple play_and_get_digits in a single dialplan. And when user inputed any matching  format of input then we need to leave all remaining play_and_get_digits commands of that dialplan. That is why I used bind_digit_action also in same dialplan.


Please suggest how do we make the changes for this concern, how do we break the dialplan when required matching input found.


Basically, its works fine as our requirement but we need to increase the DTMF delay time only, whenever user inputed slowly then its take the chunk of inputed data and tried to match the bind_digit_action  expression. As its break the DTMF into many chunks so its not matching expected regular expression of command.


Please suggest.


Thanks,


Regards,

Manish Talwar


________________________________
From: freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org> <freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org>> on behalf of Michael Collins <msc at freeswitch.org<mailto:msc at freeswitch.org>>
Sent: 26 August 2015 20:12
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] problem with "play_and_get_digits" command (DTMF delay time)

Is there a reason that you're trying to use both bind_digit_action and play_and_get_digits? Normally you'd use just one or the other, and if you're explicitly asking the user for input then I'd think that you would only need play_and_get_digits.

-MC

On Tue, Aug 25, 2015 at 5:56 AM, Manish Talwar <manish.talwar at nexxuspg.com<mailto:manish.talwar at nexxuspg.com>> wrote:

Hi,


I have found one small problem with "play_and_get_digits" command. We have a IVR application and I am trying to get  either "16 digit" card number or "0" for move to customer support from the user.  Please find my dialplan as follows:


2015-08-25 18:05:37.535806 [CRIT] mod_httapi.c:1148 Debugging Return Data:

<document type="xml/freeswitch-httapi"><params></params><work><execute applicati

on="log" data="card number inputed: 2"/><execute application="flush_dtmf"/><exec

ute application="sleep" data="2000"/><execute  application="clear_digit_action"

data="my_digit" /><execute  application="bind_digit_action" data="my_digit,~\d{1

6}|^[0]{1},exec:transfer,dummy_transfer" /><execute action="http:/

/localhost:8080/ivr/fsentercardnumber/response/"  application="play_and_get_digi

ts" data="0 16 1 1000 # en-US/enter_card_number.mp3 '' Digits '' 1000 '' " /><ge

tVariable name="Digits"/><execute action="http://localhost:8080/ivr/fsentercardnumber/response/"  a

pplication="play_and_get_digits" data="0 16 1 20000 # en-US/menu_speak_csr.mp3 '

' Digits '' 20000 '' " /><getVariable name="Digits"/><execute  application="clea

r_digit_action" data="my_digit" /></work></document>



It is working fine as expected if user input 16 digit number continuously without any delay.  After getting full 16 digit number it will match the "bind_digit_action" and move to other dialplan.


But my problem is if a user enter card number slowly then its trying to match already inputed DTMF values with matching binding and received next inputed value as different DTMF values. As a example, if I tried to input 55 and then wait for 1-2 seconds then Freeswitch tried to match 55 with binding.



2015-08-25 18:05:39.535920 [DEBUG] switch_ivr_play_say.c:1305 Codec Activated L1

6 at 8000hz 1 channels 20ms

2015-08-25 18:05:39.755933 [DEBUG] switch_rtp.c:5819 RTP RECV DTMF 5:2080

2015-08-25 18:05:40.015948 [DEBUG] switch_rtp.c:5819 RTP RECV DTMF 5:2080

2015-08-25 18:05:41.536035 [DEBUG] mod_dptools.c:132 sofia/internal/18188535351<tel:18188535351>@

192.168.1.112 Digit NOT match binding [55]

2015-08-25 18:05:41.536035 [DEBUG] switch_channel.c:486 RECV DTMF 5:2000

2015-08-25 18:05:41.536035 [DEBUG] switch_channel.c:582 sofia/internal/181885353

51 at 192.168.1.112<mailto:51 at 192.168.1.112> Queue dtmf

digit=5 ms=250 samples=2000

2015-08-25 18:05:41.536035 [DEBUG] switch_channel.c:486 RECV DTMF 5:2000

2015-08-25 18:05:41.536035 [DEBUG] switch_channel.c:582 sofia/internal/181885353

51 at 192.168.1.112<mailto:51 at 192.168.1.112> Queue dtmf

digit=5 ms=250 samples=2000



I don't want fresswtich tried to match the binding if there is any pause time while inputed the number as user can type slowly.


I want to reset this binding delay time so that user can type slowly and we will get full 16 digits number for matching inputed value in certain time interval.


Please suggest me how can I resolve this problem and increase the DTMF delay time.


Thanks,


Regards,

Manish Talwar





_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto: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


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto: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/20150831/6f0330d6/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list