Webhook API fails for first time and giving gateway timeout error

I have created a simple dialog task bot and deployed via WEBHOOK channel.

However when I followed the instructions provided in this ‘How To’s’ on integrate synchronous webhook for bot : Using Web Hook as a channel in Synchronous and Asynchronous Integration modes / How to use and integrate Kore API's

I am getting 504 - Gateway Timeout for the very first time, when we hit it with a unique id, but I am get to get the flow correct in the subsequent times.

As I am currently using a middleware to integrate it audiocodes, due to initial gateway timeout, I am either facing errors or taking 25s delay until I get started with the first webook success.

Attached the POST request endpoints and headers for validation.

  1. Endpoint URL : https://bots.kore.ai/chatbot/hooks/st-061d1f36-e682-5a39-b2da-3349258e6448
  2. Headers :
    Content-Type : application/json
    Authorization : Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJrb3Jlc3VwcG9ydEBrb3JlLmNvbSIsImFwcElkIjoiY3MtZGMxOTkzNTAtZWUwMy01NzlhLWJhMzQtZGE3N2NiZmYxMWFjIn0.lEfSp9fbgKbjKTod982qXHdU961xtmch1hHDP1k_DF8
  3. Body :
    {“message”: {
    “text” : “greet user”
    },
    “from”: {
    “id” : “q3-407a214a-ab39-5316-a4bc-2dd427c067c4”
    },
    “to” :{
    “id”: “q3-407a214a-ab39-5316-a4bc-2dd427c067c4”
    }
    }

image
image
image

Postman Response :
image

Let me know how to resolve it.

Thanks & Regards
BALA

Hi @balakrishnav,

Please let us know if the bot has botKit integrated. If yes, please check if you are observing any errors in the server side.

We are investigating the scenario at our end.

Regards,
Yoga Ramya

Hi @yogaramya.mendu

The bot is not integrated with botkit. It is only connected to a webhook channel.
Please let me know if we need integrate with botkit, will it be faster usually ?

Thanks & Regards
BALA

@balakrishnav

If you have not configured welcome message as suggested in https://developer.kore.ai/docs/bots/advanced-topics/ivr-integration/ivr-integration/#Bot_Settings please consider setting it up.

image

Thanks for your response @swagata.sengupta.

But I didn’t use the IVR channel primarily. I used webhook and connected the webhook endpoints using middleware.

The middleware server is acting as a bridge between our voice gateway (SIP Trunk Telephony) and more bot. So during the initial response is where the timeout happens, creating a long pause in the communication pipeline.

The reason for going through a middleware is because, there are a lot more operations happening due to our client’s requirement, so we can’t directly connect IVR to Kore bot.

Let me know if there’s something we can do.

Thanks & Regards
BALA

@balakrishnav
Please email us the customer name, domain, whether on prem or cloud and mention this community link on koresupport@kore.com and we will run a check if there is a Kore team working with them. If there is a team we will check with them on further details.

Thanks, everyone for your time.

finally, we have resolved the issue.
See the below image, kindly disable the Telephony Welcome Event and you’re good to go.

image (1)

Special thanks to, @swagata.sengupta @yesu.chiratanagandla @Saravanan for helping us out.

2 Likes

@balakrishnav
Just to mention for the benefit of everyone, after disabling it, one has to publish the bot.

1 Like

I am using a custom rest service in bot action node. and deploying it using WEBHOOK channel. when the bot reaches the service node, the webhook client gives no response. Any way around this?