Peter Bonnebaigt
Peter Bonnebaigt

Reputation: 157

Voximplant sendDigits method returning error in scenario

I have a scenario in my Voximplant application in which I am trying to use the sendDigits method to navigate touch tone menus.

I am not sure I am implementing it right in the scenario as the log returns an error - JS error: sendDigits is not defined.

Here is the code I am using in the scenario, everything works great up to sendDigits:

    // Navigate TouchTone Menu
    if (AI.Events.DialogflowResponse !== undefined)
     dialogflow.addEventListener(AI.Events.DialogflowResponse, (event) => {
       if (event.response.queryResult !== undefined) {
        let result = event.response.queryResult
        if (result.queryText === undefined) {
          if (result.languageCode !== undefined) startASR();
           return
         }
        if (result.parameters.TouchToneNumber !== undefined) {
            sendDigits({
              digits: result.parameters.TouchToneNumber
            })
         }
         }
      })
      // End TouchTone Code Section

Upvotes: 0

Views: 69

Answers (1)

Roman Dektyarenko
Roman Dektyarenko

Reputation: 26

Try:

if (result.parameters.TouchToneNumber !== undefined) {
             call.sendDigits({
               digits:result.parameters.TouchToneNumber
             })

sendDigits() method send DTMF digits to the remote peer. You should specify which object you are applying this method to, the call in the Voximplant scenario is the object.

Upvotes: 1

Related Questions