Peer class
Represents a peer in the WebRTC communication.
Constructors
- Peer.new(TxSocket _socket, bool _debug, TelnyxClient _txClient, bool _forceRelayCandidate)
- The constructor for the Peer class.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onAddRemoteStream ↔ dynamic Function(Session session, MediaStream stream)?
-
getter/setter pair
- onCallQualityChange ↔ CallQualityCallback?
-
Callback for call quality metrics updates.
getter/setter pair
- onCallStateChange ↔ dynamic Function(Session session, CallState state)?
-
getter/setter pair
- onDataChannel ↔ dynamic Function(Session session, RTCDataChannel dc)?
-
getter/setter pair
- onDataChannelMessage ↔ dynamic Function(Session session, RTCDataChannel dc, RTCDataChannelMessage data)?
-
getter/setter pair
- onLocalStream ↔ dynamic Function(MediaStream stream)?
-
getter/setter pair
- onPeersUpdate ↔ dynamic Function(dynamic event)?
-
getter/setter pair
- onRemoveRemoteStream ↔ dynamic Function(Session session, MediaStream stream)?
-
getter/setter pair
- onSignalingStateChange ↔ dynamic Function(SignalingState state)?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sdpSemantics → String
-
Gets the SDP semantics based on the platform.
Returns 'plan-b' for Windows and 'unified-plan' for other platforms.
no setter
Methods
-
accept(
String callerName, String callerNumber, String destinationNumber, String clientState, String callId, IncomingInviteParams invite, Map< String, String> customHeaders, bool isAttach) → Future<void> - Accepts an incoming call.
-
close(
) → Future< void> - Closes all peer connections, local streams, and the socket connection.
-
closeSession(
) → void - Closes the current session (based on _selfId).
-
createStream(
String media) → Future< MediaStream> - Creates a local media stream (audio only for web).
-
enableSpeakerPhone(
bool enable) → void -
Enables or disables the speakerphone.
enable
True to enable speakerphone, false to disable. -
initRenderers(
) → Future< void> - Initializes the local and remote video renderers.
-
invite(
String callerName, String callerNumber, String destinationNumber, String clientState, String callId, String telnyxSessionId, Map< String, String> customHeaders) → Future<void> - Initiates a new call.
-
muteUnmuteMic(
) → void - Mutes or unmutes the microphone.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remoteSessionReceived(
String sdp) → void -
Called if you receive an "answer" sdp from the server
(e.g., bridging a call scenario).
sdp
The SDP string of the remote description. -
startStats(
String callId, String peerId, RTCPeerConnection pc, {CallQualityCallback? onCallQualityChange}) → Future< bool> - Starts WebRTC statistics reporting for the given call and peer connection.
-
stopStats(
String callId) → void -
Stops WebRTC statistics reporting for the given call ID.
This only acts if debug mode is enabled.
callId
The ID of the call for which to stop stats. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited