Link Search Menu Expand Document

danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Back to index

Author: Daniil Gentili daniil@daniil.it

Controller for a Telegram end-to-end encrypted conference call

(end-to-end group calls).

It owns the two block subchains ({@see ConferenceChain} + {@see Verification}), turns the accepted blocks into media-encryption epochs, and drives a {@see GroupConnection} whose RTP frames are end-to-end encrypted by a {@see FrameCryptor} — the SFU only ever forwards ciphertext. It is both the connection’s owner and the cryptor’s key provider.

This is the public object returned by {@see \danog\MadelineProto\MTProto::createConferenceCall()} and {@see \danog\MadelineProto\MTProto::joinConferenceCall()}; it implements the common {@see Call} media interface plus conference-specific controls (verification, encrypted messages).

Properties

  • $API: danog\MadelineProto\MTProto

Method list:

Methods:

__construct(\danog\MadelineProto\MTProto $API)

Parameters:

  • $API: \danog\MadelineProto\MTProto

See also:

  • \danog\MadelineProto\MTProto

resumeAfterRestart(): void

Resume the conference after the process restarted: reopen the media connection, re-register for push updates, restart the backstop poll and catch up on any blocks missed while stopped. Named
to avoid clashing with the {@see Call} playback {@see self::resume()}.

setCall(array $call): void

Point this controller at an existing conference (its groupCall), before joining it.

Parameters:

  • $call: array

getInputCall(): array

Return value: The inputGroupCall, once the conference exists.

isJoined(): bool

Whether we are currently in the conference (joined and not left/forbidden).

isSharingScreen(): bool

Whether a screen-share is currently being transmitted.

activeEpochs(): array

selfSeed(): string

publicKeyForSsrc(int $ssrc): ?string

Parameters:

  • $ssrc: int

create(bool $muted = false): void

Create a brand-new conference call with ourselves as the sole participant and join it. Returns the raw phone.groupCall this controller now drives.

Parameters:

  • $muted: bool

join(bool $muted = false): void

Join an existing conference call: fetch the chain, add ourselves in a new block, and join with that block.

Parameters:

  • $muted: bool

removeParticipant(int ...$userIds): void

Remove participants from the conference: build a block dropping them and rekeying for the remaining members, then submit it with phone.deleteConferenceCallParticipants. Requires the
remove_users permission. The removed members can no longer decrypt media once the new epoch
takes over.

Parameters:

  • ...$userIds: int

syncChain(int $subChainId): void

Fetch and apply every block of a subchain from our current offset until caught up.

Parameters:

  • $subChainId: int

enablePresentation(): void

Start sharing a screen: a second WebRTC connection (phone.joinGroupCallPresentation) whose video is end-to-end encrypted with the same conference keys, on its own packet channel so its
sequence numbers never collide with the camera’s. Idempotent.

disablePresentation(): void

Stop sharing the screen: tear down the presentation connection and tell the server.

play(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $file, \danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): \danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Parameters:

  • $file: \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream
  • $dest: \danog\MadelineProto\MediaDestination

See also:

then(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $file, \danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): \danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Parameters:

  • $file: \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream
  • $dest: \danog\MadelineProto\MediaDestination

See also:

playOnHold(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera, \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream ...$files): \danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination
  • ...$files: \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream

See also:

skip(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): \danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

stop(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): \danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

pause(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): \danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

isPaused(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): bool

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

resume(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): \danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

getCurrent(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|string|null

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

setMuted(bool $muted = true): \danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Parameters:

  • $muted: bool

isMuted(): bool

discard(): \danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Discard (leave) the conference call.

leave(): \danog\MadelineProto\Tgcalls\E2E\ConferenceCall

Leave the conference, keeping it running for the other participants: stop the backstop poll and stop receiving its updates.

getParticipants(): array<int, array{public_key: string, permissions: int}>

The participants currently in the conference, keyed by user id, each with their Ed25519 public_key and permissions bits from the shared-state chain.

startVerification(): void

Begin (or restart) verification for the current chain head: broadcast our nonce commit, then its reveal. All participants then converge on the same four emojis.

getEmojis(): (list<string>|null)

The four verification emojis, or null until every participant’s nonce has been revealed.

sendMessage(string $message): void

Send an end-to-end encrypted in-call message to every participant (channel 0), encrypted with {@see CallPacket} for the current epochs.

Parameters:

  • $message: string

setParticipants(list<array{user_id: int, source: int, video: list<int>, presentation: list<int>, videoEndpoint: ?string, presentationEndpoint: ?string}> $participants): void

Update the SSRC -> user id map from the group call participant list, so incoming media can be attributed to a sender’s public key, and tell the connection which sources to receive.

Parameters:

  • $participants: list<array{user_id: int, source: int, video: list<int>, presentation: list<int>, videoEndpoint: ?string, presentationEndpoint: ?string}>

getChain(): \danog\MadelineProto\Tgcalls\E2E\ConferenceChain

See also:

  • \danog\MadelineProto\Tgcalls\E2E\ConferenceChain

log(string $message, int $level = \danog\MadelineProto\Logger::NOTICE): void

Parameters:

  • $message: string
  • $level: int

onIncomingSource(int $source): void

Parameters:

  • $source: int

onConnectionFailed(): void

setVideoStopped(bool $stopped): void

Parameters:

  • $stopped: bool

setPresentationPaused(bool $paused): void

Parameters:

  • $paused: bool

Generated by danog/phpdoc