Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 1 KB

sip.js.transport.ondisconnect.md

File metadata and controls

26 lines (16 loc) · 1 KB

Home > sip.js > Transport > onDisconnect

Transport.onDisconnect property

Callback on state transition from "Connected".

Signature:

onDisconnect: ((error?: Error) => void) | undefined;

Remarks

When the UserAgent is constructed, this property is set.

- The `state` MUST NOT "Connected" when called.
- If prior `state` is "Connecting" or "Connected", `error` MUST be defined.
- If prior `state` is "Disconnecting", `error` MUST NOT be undefined.

If the transition from "Connected" occurs because the transport user requested it by calling disconnect, then error will be undefined. Otherwise error will be defined to provide an indication that the transport initiated the transition from "Connected" - for example, perhaps network connectivity was lost.