CallSession class

Parses incoming matrix events to the apropriate webrtc layer underneath using a WebRTCDelegate. This class is also responsible for sending any outgoing matrix events if required (f.ex m.call.answer).

Handles p2p calls as well individual mesh group call peer connections.

Constructors

CallSession(CallOptions opts)

Properties

answeredByUs bool
no setter
callHasEnded bool
no setter
callId String
no setter
client Client
no setter
direction CallDirection
no setter
getLocalStreams List<WrappedMediaStream>
no setter
getRemoteStreams List<WrappedMediaStream>
no setter
groupCallId String?
no setter
hangupReason CallErrorCode?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isGroupCall bool
no setter
isLocalVideoMuted bool
no setter
isMicrophoneMuted bool
no setter
isOutgoing bool
no setter
isRinging bool
no setter
localHold bool
no setter
localParticipant CallParticipant?
The local participant in the call, with id userId + deviceId
no setter
localPartyId String
no setter
localScreenSharingStream WrappedMediaStream?
no setter
localUserMediaStream WrappedMediaStream?
no setter
onCallEventChanged → CachedStreamController<CallStateChange>
final
onCallHangupNotifierForGroupCalls → CachedStreamController<CallSession>
final
onCallReplaced → CachedStreamController<CallSession>
final
onCallStateChanged → CachedStreamController<CallState>
final
onCallStreamsChanged → CachedStreamController<CallSession>
final
onStreamAdd → CachedStreamController<WrappedMediaStream>
final
onStreamRemoved → CachedStreamController<WrappedMediaStream>
final
opts ↔ CallOptions
getter/setter pair
pc ↔ RTCPeerConnection?
getter/setter pair
remoteAssertedIdentity AssertedIdentity?
no setter
remoteDeviceId String?
The ID of the device being called. If omitted, any device for the remoteUserId in the room can answer.
getter/setter pair
remoteOnHold bool
no setter
remotePartyId String?
getter/setter pair
remoteScreenSharingStream WrappedMediaStream?
no setter
remoteSessionId String?
getter/setter pair
remoteUser User?
no setter
remoteUserId String?
The ID of the user being called. If omitted, any user in the room can answer.
getter/setter pair
remoteUserMediaStream WrappedMediaStream?
no setter
room Room
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screensharingEnabled bool
no setter
state CallState
no setter
type CallType
no setter
voip VoIP
no setter

Methods

addLocalStream(MediaStream stream, String purpose, {bool addToPeerConnection = true}) Future<void>
answer({String? txid}) Future<void>
answerWithStreams(List<WrappedMediaStream> callFeeds) Future<void>
cleanUp() Future<void>
createDataChannel(String label, RTCDataChannelInit dataChannelDict) Future<void>
deleteAllStreams() Future<void>
deleteFeedByStream(MediaStream stream) Future<void>
deleteStream(WrappedMediaStream stream) Future<void>
fireCallEvent(CallStateChange event) → void
gotCallFeedsForAnswer(List<WrappedMediaStream> callFeeds) Future<void>
gotCallFeedsForInvite(List<WrappedMediaStream> callFeeds, {bool requestScreenSharing = false}) Future<void>
hangup({required CallErrorCode reason, bool shouldEmit = true}) Future<void>
hasVideoToSend() Future<bool>
returns whether a 1:1 call sender has video tracks
initOutboundCall(CallType type) Future<void>
initWithInvite(CallType type, RTCSessionDescription offer, SDPStreamMetadata? metadata, int lifetime, bool isGroupCall) Future<void>
insertVideoTrackToAudioOnlyStream() Future<void>
isLocalOnHold() Future<bool>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAnsweredElsewhere() Future<void>
onAnswerReceived(RTCSessionDescription answer, SDPStreamMetadata? metadata) Future<void>
onAssertedIdentityReceived(AssertedIdentity identity) → void
onCandidatesReceived(List candidates) Future<void>
onNegotiateReceived(SDPStreamMetadata? metadata, RTCSessionDescription description) Future<void>
onNegotiationNeeded() Future<void>
onRejectReceived(CallErrorCode? reason) Future<void>
onSDPStreamMetadataReceived(SDPStreamMetadata metadata) Future<void>
onSelectAnswerReceived(String? selectedPartyId) Future<void>
placeCallWithStreams(List<WrappedMediaStream> callFeeds, {bool requestScreenSharing = false}) Future<void>
reject({CallErrorCode? reason, bool shouldEmit = true}) Future<void>
Reject a call This used to be done by calling hangup, but is a separate method and protocol event as of MSC2746.
removeLocalStream(WrappedMediaStream callFeed) Future<void>
replacedBy(CallSession newCall) Future<void>
restartIce() Future<void>
sendAnswer(RTCSessionDescription answer) Future<void>
sendAnswerCall(Room room, String callId, String sdp, String party_id, {String type = 'answer', String version = voipProtoVersion, String? txid, CallCapabilities? capabilities, SDPStreamMetadata? metadata}) Future<String?>
This event is sent by the callee when they wish to answer the call. callId is a unique identifier for the call. version is the version of the VoIP specification this message adheres to. This specification is version 1. type The type of session description. Must be 'answer'. sdp The SDP text of the session description. party_id The party ID for call, Can be set to client.deviceId.
sendAssertedIdentity(Room room, String callId, String party_id, AssertedIdentity assertedIdentity, {String version = voipProtoVersion, String? txid}) Future<String?>
send AssertedIdentity event
sendCallCandidates(Room room, String callId, String party_id, List<Map<String, dynamic>> candidates, {String version = voipProtoVersion, String? txid}) Future<String?>
This is sent by callers after sending an invite and by the callee after answering. Its purpose is to give the other party additional ICE candidates to try using to communicate.
sendCallNegotiate(Room room, String callId, int lifetime, String party_id, String sdp, {String type = 'offer', String version = voipProtoVersion, String? txid, CallCapabilities? capabilities, SDPStreamMetadata? metadata}) Future<String?>
When local audio/video tracks are added/deleted or hold/unhold, need to createOffer and renegotiation. callId is a unique identifier for the call. version is the version of the VoIP specification this message adheres to. This specification is version 1. party_id The party ID for call, Can be set to client.deviceId.
sendCallReject(Room room, String callId, String party_id, {String version = voipProtoVersion, String? txid}) Future<String?>
Reject a call callId is a unique identifier for the call. version is the version of the VoIP specification this message adheres to. This specification is version 1. party_id The party ID for call, Can be set to client.deviceId.
sendCallReplaces(Room room, String callId, String party_id, CallReplaces callReplaces, {String version = voipProtoVersion, String? txid}) Future<String?>
CallReplacesEvent for Transfered calls
sendDTMF(String tones) Future<void>
sendHangupCall(Room room, String callId, String party_id, String? hangupCause, {String version = voipProtoVersion, String? txid}) Future<String?>
This event is sent by the callee when they wish to answer the call. callId The ID of the call this event relates to. version is the version of the VoIP specification this message adheres to. This specification is version 1. party_id The party ID for call, Can be set to client.deviceId.
sendInviteToCall(Room room, String callId, int lifetime, String party_id, String sdp, {String type = 'offer', String version = voipProtoVersion, String? txid, CallCapabilities? capabilities, SDPStreamMetadata? metadata}) Future<String?>
This is sent by the caller when they wish to establish a call. callId is a unique identifier for the call. version is the version of the VoIP specification this message adheres to. This specification is version 1. lifetime is the time in milliseconds that the invite is valid for. Once the invite age exceeds this value, clients should discard it. They should also no longer show the call as awaiting an answer in the UI. type The type of session description. Must be 'offer'. sdp The SDP text of the session description. invitee The user ID of the person who is being invited. Invites without an invitee field are defined to be intended for any member of the room other than the sender of the event. party_id The party ID for call, Can be set to client.deviceId.
sendSDPStreamMetadataChanged(Room room, String callId, String party_id, SDPStreamMetadata metadata, {String version = voipProtoVersion, String? txid}) Future<String?>
Send SdpStreamMetadata Changed event.
sendSelectCallAnswer(Room room, String callId, String party_id, String selected_party_id, {String version = voipProtoVersion, String? txid}) Future<String?>
The calling party sends the party_id of the first selected answer.
setCallState(CallState newState) → void
setLocalVideoMuted(bool muted) Future<void>
setMicrophoneMuted(bool muted) Future<void>
setRemoteOnHold(bool onHold) Future<void>
setScreensharingEnabled(bool enabled) Future<bool>
terminate(CallParty party, CallErrorCode reason, bool shouldEmit) Future<void>
toString() String
A string representation of this object.
inherited
tryRemoveStopedStreams() Future<void>
updateMediaDeviceForCall() Future<void>
updateMuteStatus() Future<void>

Operators

operator ==(Object other) bool
The equality operator.
inherited