Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 2.09 KB

sip.js.transport.md

File metadata and controls

44 lines (32 loc) · 2.09 KB

Home > sip.js > Transport

Transport class

Transport for SIP over secure WebSocket (WSS).

Signature:

export declare class Transport implements TransportDefinition 

Implements: TransportDefinition

Constructors

Constructor Modifiers Description
(constructor)(logger, options) Constructs a new instance of the Transport class

Properties

Property Modifiers Type Description
onConnect (() => void) | undefined
onDisconnect ((error?: Error) => void) | undefined
onMessage ((message: string) => void) | undefined
protocol string The protocol.
server string The URL of the WebSocket Server.
state TransportState Transport state.
stateChange Emitter<TransportState> Transport state change emitter.
ws WebSocket | undefined The WebSocket.

Methods

Method Modifiers Description
connect() Connect to network. Resolves once connected. Otherwise rejects with an Error.
disconnect() Disconnect from network. Resolves once disconnected. Otherwise rejects with an Error.
dispose()
isConnected() Returns true if the state equals "Connected".
send(message) Sends a message. Resolves once message is sent. Otherwise rejects with an Error.