Class SIPConnectorAbstract

SIPConnector is a common abstract class for negotiating a new RTCPeerConnection connection with the server.

The child class must implement the _sip method to send the offer to the server and get the answer.

Hierarchy

Implements

Constructors

  • Create a new SIPConnector instance. The RTCPeerConnection is created only when calling _open().

    By default, a listener channel is negotiated. To create a streamer channel, pass a stream parameter.

    Parameters

    • connectParams: Params
    • Optional stream: MediaStream

    Returns SIPConnector

Properties

_closed: boolean
_codecs: Set<string>
_connectionInfos?: ConnectionInfos
_connectionInfosTime: number
_endPoint: string
_peerConnection?: RTCPeerConnection
_peerConnectionIdleTimeout?: Timeout
_stream?: MediaStream
_streamName: string
log: ILog

Start a log

Param

Returns

a Log object with the levels of log to call

Accessors

  • get stream(): undefined | MediaStream
  • Media Stream description delivred from the server if we are player, or build from the local camera if we are the streamer.

    Returns undefined | MediaStream

Methods

  • Main function which creates the RTCPeerConnection, creates the offer, calls the _sip method, then set the answer and calls onOpen

    Parameters

    • Optional iceServer: RTCIceServer

    Returns void

  • Operates Session Initiation Protocol, this method implement the logic to send the SDP offer to the server and get the SDP answer in response.

    Parameters

    • offer: string

      SIP Offer

    Returns Promise<string>

    a Promise with SIP Answer as result

  • Event unsubscription

    Parameters

    • name: "open" | "close" | "Close" | "Open"

      Name of event without the 'on' prefix (ex: 'log' to 'onLog' event declared)

    • event: Function

      Unsubscriber Function, must be the one passed to on or once subscription methods

    Returns boolean

  • Event subscription

    Parameters

    • name: "open" | "close" | "Close" | "Open"

      Name of event without the on prefix (ex: log to onLog event declared)

    • event: Function

      Subscriber Function

    • Optional options: {
          signal?: AbortSignal;
      }
      • Optional signal?: AbortSignal

        Optional AbortSignal to stop this or multiple subscriptions in same time

    Returns void

  • Event subscription only one time, once time fired it's automatically unsubscribe

    Parameters

    • name: "open" | "close" | "Close" | "Open"

      Name of event without the on prefix (ex: log to onLog event declared)

    • event: Function

      Subscriber Function

    • Optional options: {
          signal?: AbortSignal;
      }
      • Optional signal?: AbortSignal

    Returns void

  • Fill the codecs set with the codecs found in the sdp

    Parameters

    • sdp: string

      the sdp to parse

    Returns void

Events

  • Call when connector is open

    Parameters

    • stream: MediaStream

      MediaStream description provided from the server if we are the player, or build from the local camera if we are the streamer.

    Returns void

Generated using TypeDoc