Search code examples
node.jsaws-lambdaalexa-skills-kitalexa-slot

Intent immediately defaults to FallbackIntent, even with incredibly specific utterance


the utterance
the slot being used

the testing screen

the intent in my lambda function:

var phoneNumber;    
"getPhoneNumberIntent": function() {
    phoneNumber = this.event.request.intent.slots.phoneNumber.value;
    if (getLength(phoneNumber) === 10) {
        this.response.speak('I heard <say-as interpret-as="telephone"> ' + phoneNumber + '</say-as>. Is this the correct number?').listen();
        this.emit(':responseReady');
    } else {
        console.log(phoneNumber);
        this.response.speak('That is not a valid phone number. Please try again.').listen();

    }
},

When I type in the incredibly specific utterance, The only thing in the output JSON is null. and in the input, the proper intent wasn't even being called. I have not seen a problem similar to mine on the website, I've looked high and low. Any help or feedback is appreciated.


Solution

  • Use predefined AMAZON.NUMBER as the slot type for phoneNumber.

    While testing numbers in Alexa Test Simulator, represent them as words

    Ex: the phone number is nine eight seven six five four three two one zero

    And for abbreviations use period "."

    Ex: The code is a.w.e.