sip.js.sessiondescriptionhandler.md

October 21, 2022 ยท View on GitHub

Home > sip.js > SessionDescriptionHandler

SessionDescriptionHandler class

A base class implementing a WebRTC session description handler for sip.js.

Signature:

export declare class SessionDescriptionHandler implements SessionDescriptionHandlerDefinition 

Implements: SessionDescriptionHandlerDefinition

Remarks

It is expected/intended to be extended by specific WebRTC based applications.

Constructors

ConstructorModifiersDescription
(constructor)(logger, mediaStreamFactory, sessionDescriptionHandlerConfiguration)Constructor

Properties

PropertyModifiersTypeDescription
_dataChannelRTCDataChannel | undefinedThe data channel. Undefined before created.
_localMediaStreamMediaStreamThe local media stream.
_peerConnectionRTCPeerConnection | undefinedThe peer connection. Undefined after SessionDescriptionHandler.close().
_peerConnectionDelegatePeerConnectionDelegate | undefinedThe peer connection delegate.
_remoteMediaStreamMediaStreamThe remote media stream.
dataChannelRTCDataChannel | undefinedThe data channel. Undefined before it is created.
localMediaStreamMediaStreamThe local media stream currently being sent.
loggerLoggerLogger.
mediaStreamFactoryMediaStreamFactoryMedia stream factory.
peerConnectionRTCPeerConnection | undefinedThe peer connection. Undefined if peer connection has closed.
peerConnectionDelegatePeerConnectionDelegate | undefinedA delegate which provides access to the peer connection event handlers.
remoteMediaStreamMediaStreamThe remote media stream currently being received.
sessionDescriptionHandlerConfigurationSessionDescriptionHandlerConfigurationConfiguration options.

Methods

MethodModifiersDescription
applyModifiers(sdp, modifiers)Applies modifiers to SDP prior to setting the local or remote description.
close()Stop tracks and close peer connection.
createDataChannel(options)Create a data channel.
createLocalOfferOrAnswer(options)Depending on current signaling state, create a local offer or answer.
enableReceiverTracks(enable)Helper function to enable/disable media tracks.
enableSenderTracks(enable)Helper function to enable/disable media tracks.
getDescription(options, modifiers)Creates an offer or answer.
getLocalMediaStream(options)Get a media stream from the media stream factory and set the local media stream.
getLocalSessionDescription()Gets the peer connection's local session description.
hasDescription(contentType)Returns true if the SessionDescriptionHandler can handle the Content-Type described by a SIP message.
iceGatheringComplete()Called when ICE gathering completes and resolves any waiting promise.
sendDtmf(tones, options)Send DTMF via RTP (RFC 4733). Returns true if DTMF send is successful, false otherwise.
setDescription(sdp, options, modifiers)Sets an offer or answer.
setLocalMediaStream(stream)Sets the peer connection's sender tracks and local media stream tracks.
setLocalSessionDescription(sessionDescription)Sets the peer connection's local session description.
setRemoteSessionDescription(sessionDescription)Sets the peer connection's remote session description.
setRemoteTrack(track)Sets a remote media stream track.
updateDirection(options)Depending on the current signaling state and the session hold state, update transceiver direction.
waitForIceGatheringComplete(restart, timeout)Wait for ICE gathering to complete.