Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 2.17 KB

sip.js.transport.md

File metadata and controls

43 lines (31 loc) · 2.17 KB

Home > sip.js > Transport

Transport class

Transport for SIP over secure WebSocket (WSS).

Signature:

export declare class Transport 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.