Home > sip.js > Transport > disconnect
Disconnect from network.
Signature:
disconnect(): Promise<void>;
Returns:
Promise<void>
- If `state` is "Connecting", `state` MUST transition to "Disconnecting" before returning.
- If `state` is "Connected", `state` MUST transition to "Disconnecting" before returning.
- If `state` is "Disconnecting", `state` MUST NOT transition before returning.
- If `state` is "Disconnected", `state` MUST NOT transition before returning.
- The `state` MUST transition to "Disconnected" before resolving (assuming `state` is not already "Disconnected").
- The `state` MUST transition to "Connecting" or "Connected" before rejecting and MUST reject with an Error.
Resolves when the transport disconnects. Rejects if transport fails to disconnect. Rejects with StateTransitionError if a loop is detected. In particular, callbacks and emitters MUST NOT call this method synchronously.