Viewing 2 posts - 1 through 2 (of 2 total)
  • Migrated from old forum
    Participant
    Post count: 327
    #5967 |

    Hello,

    I have a script which has four questions to be answered 1 or 0 via DTMF input. If someone doesn’t answer the question I want to set a default answer so I have set four channel variables as follows:

    ANSWER1
    ANSWER2
    ANSWER3
    ANSWER4

    I have also set a global variable which contains the default answer:

    ANSWERDEFAULT = 1

    If I use the variable set function to set each of the channel variable to ANSWERDEFAULT before prompting using the Read DTMF function I had expected that if there is no answer to the questions and they time out that in the above example each answer would end up as “1”. However the ANSWER1-4 variables appear to be undefined and so don’t get saved back to the database.

    Am I doing something wrong here or have I misunderstood how Read DTMF works? If I actually respond to the questions all of the answers get saved correctly to the database.

    Thanks,

    Lee

    Migrated from old forum
    Participant
    Post count: 327
    #5968 |

    Lee,

    If the ‘timeout’ is reached before the caller enters any digits, the ANSWER 1-4 variables will be undefined (empty string).
    To handle this situation I would probably go with GotoIf block and expression like: $”${ANSWER1}” = “””” and then branch the call flow based on the expression result.
    In case the result is true I would set ANSWER1 = ANSWERDEFAULT.

    I hope this helps.

    lexy

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.