Jump to content
  • 0

Connect to Websocket Datachannel

Daniel Biagi



I am trying to setup a NodeJS listener on the publisher's data channel but I can't figure out how to do it properly.

I tried using a npm package called wrtc but it seems it operates a little different than AMS.

What should I use on these variables (marked with bold)?

{    command : "takeCandidate",    streamId : "stream1",    label : "${CANDIDATE.SDP_MLINE_INDEX}",    id : "${CANDIDATE.SDP_MID}",    candidate : "${CANDIDATE.CANDIDATE}"}

I am able to joinRoom and then get some ping/pongs, but after some seconds apparently the connection is dropped (maybe because I didn't answer the candidates) with the message:

Received: '{"streamId":"3ZWSlhKwKfnYa4aJ26nmA749K3","definition":"play_finished","command":"notification"}'

Could you help me setting this up correctly, please?


Daniel Biagi
Link to comment
Share on other sites

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Posted Images

1 answer to this question

Recommended Posts

  • 0

Hi Daniel,

Thank you for the great question!

You can check SDP parameters in WebSocket Messages Tab on Google Console log for debugging. I attached sample WebRTC Conference Room WebSocket messages.

Also, you check our WebRTC Javascript SDK and WebRTC Conference page as below:

Btw, could you please add your AMS logs(/usr/local/antmedia/log/ant-media-server.log file)? 

Best Regards,





Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...