Question about Read() application

Home » Asterisk Users » Question about Read() application
Asterisk Users 8 Comments

Hello again list,

Did the following: (on 1.4.42 installation)

asterisk -rx “core show application read”

-= Info about application ‘Read’ =-

[Synopsis]

Read a variable

[Description]

Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])

Reads a #-terminated string of digits a certain number of times from the

user in to the given variable.

filename — file to play before reading digits or tone with option i

maxdigits — maximum acceptable number of digits. Stops reading after

maxdigits have been entered (without requiring the user to

press the ‘#’ key).

Defaults to 0 – no limit – wait for the user press the ‘#’
key.

Any value below 0 means the same. Max accepted value is 255.

option — options are ‘s’ , ‘i’, ‘n’

‘s’ to return immediately if the line is not up,

‘i’ to play filename as an indication tone from your
indications.conf

‘n’ to read digits even if the line is not up.

attempts — if greater than 1, that many attempts will be made in the

event no data is entered.

timeout — An integer number of seconds to wait for a digit response.
If greater

than 0, that value will override the default timeout.

Read should disconnect if the function fails or errors out.

I need for Asterisk to “keep going” if I have a problem with Read() or at
least playback some kind of warning. Any suggestions?

P.S. The “Read should disconnect” line does not show up in my 10.0
install.

Thanks

Danny Nicholas

8 thoughts on - Question about Read() application

  • What sort of “problem with Read()” are you expecting to encounter, and
    what do you mean by “keep going”?

    Cheers,
    Kingsley.

  • If you read the last line of the synopsis, it states that
    “Read should disconnect if the function fails or errors out.”

    I’m using Read() in an IVR context where I read an account number, then a password, then return information. This usually works well to the tune of 44K transactions a month, but I will have around 1 percent of my calls ask for the account number and hang up the call because Read() failed and didn’t say anything. Perfection doesn’t seem necessary until somebody complains because you don’t have it.

  • Do you know if the failure was caused my user action (or lack of, ie
    they didn’t send digits), or a technical problem?

    Cheers,
    Kingsley.

  • The user reported to me that “I punched 1 and it hung up” – in my testing, I found that slow DTMF entry (1 digit every 2 seconds or so) or fast entry (more than 10 digits per second) was most likely to cause the problem.

  • Danny Nicholas wrote:

    I’ve never had mine just hangup on a mis-key, but then again I have it
    try 3 times before considering it a failure.

    exten => s,1,Read(get-admin-password|enter-password|||3|)

    Doug

  • My IVR wouldn’t sound right if I allowed 2 or 3 times before it was
    considered a failure. The big(ger) problem is that it just hangs up when
    it fails, no warning or work around to do.

  • Hi,

    Did you get a workaround for this? I sent you a message offlist but you
    didn’t reply so I don’t know whether you saw it.

    Cheers,
    Kingsley.

  • I tried to patch app_read on my development dahdi box as follows:
    static int unload_module(void)
    {
    int res;

    res = ast_unregister_application(app);

    /* ast_module_user_hangup_all(); */

    return res;
    }
    But the offending behavior persists – it’s not a “show-stopper” but it
    eventually could be.