question

R avatar image
R asked

IntentHandler not getting fired for the utterances

Here is what I have - 2 intents (RequestBookingIntent and ConfirmBookingIntent):

1.RequestBookingIntent

https://i.stack.imgur.com/wxRWc.png


2.ConfirmBookingIntent

https://i.stack.imgur.com/bbjYE.png


The corresponding 2 intent handlers and those handlers added to the request handlers collection are shown below


exports.handler = Alexa.SkillBuilders.custom()

.addRequestHandlers(

LaunchRequestHandler,

HelloWorldIntentHandler,

RequestBookingIntentHandler,

ConfirmBookingIntentHandler,

HelpIntentHandler,...


const RequestBookingIntentHandler = {

canHandle(handlerInput) {

return handlerInput.requestEnvelope.request.type === 'IntentRequest'

&& handlerInput.requestEnvelope.request.intent.name === 'RequestBookingIntent';

},

handle(handlerInput) {

const speechText = 'Your favorite room...';

return handlerInput.responseBuilder

.speak(speechText)...


const ConfirmBookingIntentHandler = {

canHandle(handlerInput) {

return handlerInput.requestEnvelope.request.type === 'IntentRequest'

&& handlerInput.requestEnvelope.request.intent.name === 'ConfirmBookingIntent';

},

handle(handlerInput) {

const speechText = 'Ok confirmed!';

return handlerInput.responseBuilder

.speak(speechText)....


But the second intent handler never gets fired as shown below

https://i.stack.imgur.com/GfiRe.png


In the above figure with the input of text i am loosing my sleep on this the ConfirmBookingIntent should have sent Ok confirmed! but instead, I got the (blue background) generic text Sorry, I don't know that one.


Any hint is much appreciated.

Thanks a lot!

Ram

alexa skills kitalexalambda
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

R avatar image
R answered

Adding the following line to the responseBuilder fixed the issue.


.withShouldEndSession(false)


10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.