files/en-us/web/api/rtcpeerconnection/signalingstate/index.md
{{APIRef("WebRTC")}}
The signalingState read-only property of the {{domxref("RTCPeerConnection")}} interface returns a string value describing the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer.
See Signaling in our WebRTC session lifetime page.
Because the signaling process is a state machine, being able to verify that your code is in the expected state when messages arrive can help avoid unexpected and avoidable failures.
For example, if you receive an answer while the signalingState isn't "have-local-offer", you know that something is wrong, since you should only receive answers after creating an offer but before an answer has been received and passed into {{domxref("RTCPeerConnection.setLocalDescription()")}}. Your code will be more reliable if you watch for mismatched states like this and handle them gracefully.
This value may also be useful during debugging, for example.
In addition, when the value of this property changes, a {{DOMxRef("RTCPeerConnection/signalingstatechange_event", "signalingstatechange")}} event is sent to the {{domxref("RTCPeerConnection")}} instance.
The allowed string values are:
stable
null;
it may also mean that negotiation is complete and a connection has been established.have-local-offer
have-remote-offer
have-local-pranswer
have-remote-pranswer
setLocalDescription().closed
const pc = new RTCPeerConnection(configuration);
const state = pc.signalingState;
{{Specifications}}
{{Compat}}