ServiceNown stream end immediatly after a call through Twilio

User687957
Tera Contributor

Dear all,

I have a wierd issue when trying to integrate Twilio with servicenow.
I go through all the docs for configuring assistant and authentication as below

chrome_yHW4eIFN4M.png


When I dial the Trial twilio number, there is the trial message hangs up immediatly.
When I check in tiwllio log I have the following :
"

Error

31921 Stream - WebSocket - Close Error (Connection reset without closing handshake)"

It is then saying that this is the server ( ServiceNow) which hangs the connection and ask to go to logs.

What is the log tables for Assistant configuration ?

Thanks for help
regards



4 REPLIES 4

Tanushree Maiti
Tera Sage

 

Hi @User687957 ,

 

Did you get any place to set your MID server.

 

WebSocket connection errors

When a client attempts to communicate over WebSocket, it first assumes the server supports the protocol. If the client does not receive an acknowledgment from the server, the following error appears in the browser console log:

js_includes_concourse.jsx?v=05-01-2020_1402&lp=Sun_Jun_07_18_36_34_PDT_2020&c=38_1037:3084 WebSocket connection to 'wss://<instance_name>.service-now.com/amb' failed: Error during WebSocket handshake: Unexpected response code: 400
(anonymous) @ js_includes_concourse.jsx?v=05-01-2020_1402&lp=Sun_Jun_07_18_36_34_PDT_2020&c=38_1037:3084

If the communication channel is blocked by a firewall, load balancer, VPN, or proxy rule, this error is expected. The client automatically falls back to long-polling (HTTP) when WebSocket is not available.

 

Refer: https://www.twilio.com/docs/api/errors/31921

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0829978#:~:text=WebSocket%20c....

 

 

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Hello @Tanushree Maiti , our ServiceNow instance is a cloud instance , there is notthing related to Mid Server in our config

I know servicenow instance is cloud instance. 

Can you check this sys property  glide.cometd.websocket.enabled value and confirm here

 

Also share the document link which you followed to set up the integration.

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

hello  @Tanushree Maiti ,

here is the link to document configuration I follow :

https://www.servicenow.com/docs/r/zurich/intelligent-experiences/integrate-voice-service-with-twilio...

https://www.servicenow.com/docs/r/zurich/intelligent-experiences/create-an-ai-voice-service.html

https://www.servicenow.com/docs/r/zurich/platform-security/authentication/configuring-authentication...

Relative to the property "glide.cometd.websocket.enabled" , I do not have it in sys_properties table 

By the way I run the web socket test and here is the results below :

WebSocket Test
[Testing sequence]
1) Send a WebSocket Upgrade Request to the echo endpoint
2) If the server responds with a WebSocket upgrade response, send a frame and start a timer of 3 seconds
[WebSocket network assertion]
If a WebSocket frame does not echo within the 3 second timeout, then WebSockets is considered not to work in this environment
else if a WebSocket frame comes back but is not the same as what was sent, then WebSockets is considered not to work
If a frame comes back within the 3 second time and is the same, WebSockets is working okay in this environment
TESTING...
WEBSOCKET UPGRADE REQUEST SENT FROM CLIENT TO SERVER

WEBSOCKET UPGRADE REQUEST ACCEPTED BY SERVER

SENDING A WEBSOCKET FRAME TO THE SERVER: [ 3712 ]

SERVER RESPONDED WITH FRAME: [ 3712 ]

THE NETWORK TOPOLOGY IS WEBSOCKET FRIENDLY AND WEBSOCKET FRAMES ARE PROPERLY TRANSMITTED

SUCCESS!

WEBSOCKET CONNECTION CLOSED

CLOSE CODE: [1000]

DID THIS CONNECTION CLOSE IN A CLEAN MANNER: [true]


I run also the follwoing test using free webook and add the url to twilio . Then by sending the follwoing powershell command it return "Sucess":

 Invoke-RestMethod -Uri "https://wh17f60bd23f33528d75.free.beeceptor.com" -Method POST -ContentType "application/x-www-form-urlencoded" -Body "From=+1814740334&To=+18147403025&Body=Test call"


If I run the same command with return endpoint from Assistant Agent config i get the following response :

xml                            Response
---                            --------
version="1.0" encoding="UTF-8" Response


If you have any idea, would be so happy
Regards