Class CallService
Matrix 1:1 calls of the logged-in user: places calls, raises incoming ones, and routes the events of the synced timelines to their VoiceCall; sends through the outbox, which encrypts in encrypted rooms.
Namespace: Uniform.Matrix.Calls
Assembly: Uniform.Matrix.Calls.dll
public sealed class CallService : IAsyncDisposable
Constructors
|
Edit this page
View Source
Follow the synced timelines for call events, and the to-device messages for MatrixRTC's keys.
Declaration
public CallService(SyncProcessor processor, OutboxSender outbox, ClientSession session, NetworkMonitor network, ILogger<CallService> logger, CryptoService? crypto = null)
Parameters
Properties
|
Edit this page
View Source
Declaration
public IReadOnlyList<VoiceCall> ActiveCalls { get; }
Property Value
|
Edit this page
View Source
Opens the platform's camera, for calls answered with video; null where there is none, as on desktops for now.
Declaration
public Func<IVideoCamera?>? Camera { get; set; }
Property Value
|
Edit this page
View Source
Open the microphone and speaker of a call; the platform's devices by default, which Android replaces.
Declaration
public Func<IAudioDevices?> Devices { get; set; }
Property Value
|
Edit this page
View Source
Whether to accept the video a caller offers, to show it; this side sends none. On by default.
Declaration
public bool ReceiveVideo { get; set; }
Property Value
|
Edit this page
View Source
Whether calls go through TURN only, so the peer does not learn this device's addresses.
Declaration
public bool RelayOnly { get; set; }
Property Value
|
Edit this page
View Source
Whether to place calls over MatrixRTC when the homeserver has a LiveKit transport; on by default. Off places m.call.* calls only.
Declaration
public bool UseMatrixRtc { get; set; }
Property Value
|
Edit this page
View Source
Makes a decoder of a peer's video, e.g. the platform's hardware one; null for the C# decoder, as on desktops.
Declaration
public Func<IVideoDecoder?>? VideoDecoder { get; set; }
Property Value
Methods
|
Edit this page
View Source
Hang up all calls, and stop following the timelines; a server that does not answer holds each hangup for a few seconds at most.
Declaration
public ValueTask DisposeAsync()
Returns
|
Edit this page
View Source
Return the call in a room that has not ended, or null.
Declaration
public VoiceCall? FindCall(string roomId)
Parameters
| Type |
Name |
Description |
| string |
roomId |
|
Returns
|
Edit this page
View Source
Call the other member of a room with two members, e.g. a direct chat.
Declaration
public Task<VoiceCall> PlaceCallAsync(string roomId, CancellationToken cancellationToken = default)
Parameters
Returns
Exceptions
|
Edit this page
View Source
Call the other member of a direct room with video too: this side's camera, when Camera has one, and the peer's when it sends; or answer their call that rings, with video.
Declaration
public Task<VoiceCall> PlaceVideoCallAsync(string roomId, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Return when a ring of lifetime milliseconds stops ringing: from its sender's time, or from the server's when the two differ by more than 20 seconds either way, as a sender's clock may be off, e.g. by its time zone; at most two minutes.
Declaration
public static DateTimeOffset RingExpiry(long senderTs, long originServerTs, long lifetime)
Parameters
| Type |
Name |
Description |
| long |
senderTs |
|
| long |
originServerTs |
|
| long |
lifetime |
|
Returns
Events
|
Edit this page
View Source
Raised when a call changes state or mute; on any thread.
Declaration
public event Action<VoiceCall>? CallChanged
Event Type
|
Edit this page
View Source
Raised for a new incoming call that rings.
Declaration
public event Action<VoiceCall>? IncomingCall
Event Type
Implements