Skip to main content
Triggered when a WebRTC answer is received through the unified WebSocket connection. This is the response to a WebRTC offer.

Event Properties

string
Event type. Always "webrtc.signaling.answer" for this event.
object
Event data object containing WebRTC answer information.
object
The SDP (Session Description Protocol) answer object. This is an RTCSessionDescription object that needs to be set as the remote description.Example:

Sending Answer

After receiving a WebRTC offer, you need to create an answer and send it back. Here’s how to send the answer:
Message Structure: When sending an answer, the message structure should be:
Key Points:
  • The sdp parameter in data.sdp should be an RTCSessionDescription object (or equivalent plain object) with:
    • type: "answer"
    • sdp: The SDP string containing the answer description
  • Send the answer immediately after you receive an offer and create an answer using peerConnection.createAnswer()
  • Use peerConnection.localDescription as the sdp value when sending

Receiving Answer

When you receive an answer (if you sent an offer), handle it like this:
  • When to send: Send an answer immediately after receiving an offer and creating an answer with peerConnection.createAnswer()
  • What to send: Send peerConnection.localDescription (which is an RTCSessionDescription object) as the sdp value
  • WebRTC signaling is sent through the unified WebSocket connection