Websocket connection error in asterisk

I have tried to establish a websocket connection from a browser to my asterisk server(13.17). But I have ended with the following error in asterisk console.

"res_http_websocket.c:773 __ast_websocket_uri_cb: WebSocket connection from ‘10.x.x.x:port’ could not be accepted - did not request WebSocket".

I have tried the following url.

http://10.x.x.x:8088/ws

In browser , I have ended with the following message.

Upgrade Required

Asterisk/13.17.0.

That is not how websocket is requested. A websocket URL would be “ws://10.x.x.x:8088/ws” and a Javascript application would need to establish the Websocket connection.

@jcolp
Thanks for the response.

Actually what my requirement is , I need to use asterisk as a signalling server for WebRTC.

I don’t know from where to start it.

Could you please guide me.

There is a guide provided on the wiki for using the SIP support over Websockets. If you want to use your own signaling protocol, you would need to add support to Asterisk for it.

@jcolp
Thanks for the response.

Somehow I have configured webrtc in asterisk.

I tried to test webrtc using sipml5. But I have repeatedly facing the following error.

ERROR[17242]: tcptls.c:695 handle_tcptls_connection: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[2019-09-23 18:59:07] WARNING[17242]: tcptls.c:782 handle_tcptls_connection: FILE * open failed!

In browser console, it shows the following error.

tsip_transport.js?svn=252:359 WebSocket connection to ‘wss://10.x.x.x:8089/ws’ failed: Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID

Tell the browser to trust the certifier.

@david551
Thanks for the response.

I am using sipml5 webrtc client in my local to test webrtc.
The extensions are registered successfully.
But I am facing following error during call in browser.

TypeError: getPlugin(…).createPeerConnection is not a function
** at new RTCPeerConnection (VM306 adapter.js:471)**
** at tmedia_session_jsep01.__get_lo (tmedia_session_jsep.js?svn=252:655)**
** at tmedia_session_jsep01.tmedia_session.get_lo (tmedia_session.js?svn=252:583)**
** at tmedia_session_mgr.get_lo (tmedia_session.js?svn=252:285)**
** at tsip_dialog_invite.send_offer (tsip_dialog_invite.js?svn=252:288)**
** at tsip_dialog_invite.send_invite (tsip_dialog_invite.js?svn=252:263)**
** at tsk_fsm_entry.c0000_Started_2_Outgoing_X_oINVITE [as fn_execute] (tsip_dialog_invite__client.js?svn=252:90)**
** at tsk_fsm.act (VM324 tsk_fsm.js:91)**
** at tsip_dialog_invite.tsip_dialog.fsm_act (tsip_dialog.js?svn=252:750)**
** at tsip_session_invite.call (tsip_api_invite.js?svn=252:155)**

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.