Skip to main content

Local D-Bus control API (Linux)

The optional control service exposes a deliberately small set of named Teams actions and observed state on the user session bus. Enable it with { "dbusControl": { "enabled": true } } in the application configuration, then restart Teams for Linux. It is Linux-only and disabled by default. The service and its state observer start only with this opt-in. The renderer status/media monitors run when MQTT or Linux D-Bus control is enabled; existing overlay and macOS dock behavior remains independent. Meeting detection additionally requires mqtt.meetingStartDetection.enabled, with resetSeconds controlling the pulse duration (default 10 seconds).

ItemValue
BusUser session bus
ServicedbusControl.busName when set; otherwise $FLATPAK_ID or com.github.IsmaelMartinez.teams_for_linux
Object path/com/github/IsmaelMartinez/teams_for_linux
Interfacecom.github.IsmaelMartinez.teams_for_linux.Control

Methods​

MethodSignatureMeaning
AcceptAudio, AcceptVideo, DeclineCall() -> bDispatch the corresponding action for the known incoming call
ToggleMute, ToggleVideo, ToggleHandRaise, LeaveCall() -> bUse the application's fixed Teams shortcut mapping
Mute, Unmute(b force) -> bSet desired mute state; already-desired state returns false. Unknown state requires force=true; argument must be Boolean.
SetStatus(s status) -> bSet the selected profile's Teams status. Accepted values are available, busy, do_not_disturb, away, be_right_back, and offline.
GetState() -> sCurrent JSON state snapshot

true means dispatch, not acknowledgement from Teams. Incoming-call actions target the latest ringing renderer; shortcuts and SetStatus target the selected profile and fail closed if its renderer is unavailable. SetStatus obtains an in-memory token for Teams' own presence service in the selected renderer, then uses its forceavailability endpoint; the token is never returned by D-Bus or persisted by Teams for Linux. That endpoint is undocumented and not part of Microsoft Graph: the current Teams web client still uses it, but it is region-routed and Microsoft may change or restrict it without notice. There is intentionally no arbitrary shortcut method or calendar/Graph API in this first version. Thus only named commands can request fixed actions.

Signals and state​

Signals: StateChanged(s stateJson), PresenceChanged(s status, i statusCode), InCallChanged(b), IncomingCallChanged(b), IncomingCallCallerChanged(s callerJson), CameraChanged(b), MicrophoneChanged(s), MicrophoneControlChanged(s), ScreenSharingChanged(b), MeetingStartedChanged(b), and CallParticipantsChanged(s participantsJson). StateChanged carries the full snapshot; typed signals follow when values change. Call GetState after connecting for an immediate snapshot. No D-Bus properties are exported because the installed dbus-native version exposes properties read/write.

The snapshot has exactly eleven keys: presenceStatus, presenceStatusCode, inCall, incomingCall, incomingCallCaller, cameraEnabled, microphoneState, microphoneControlState, screenSharing, meetingStarted, callParticipants. Presence, call and media state are scoped to the selected profile, not an aggregate across accounts; unobserved values are false/unknown rather than stale data from another profile. Incoming-call fields describe the latest ringing renderer, independently of the selected profile. Initial presence/microphone state is unknown, booleans are false, and caller is null. These are observations, not server-confirmed Teams state.

Caller information remains opt-in through config.mqtt.incomingCallCaller.enabled, independently of MQTT being enabled. If enabled, caller details may appear in broadcast state signals. The same opt-in requirement applies to other transports; D-Bus caller identity is not used for authorization. The bus API is available to clients on the user session bus and does not add per-caller access control.

Call participants​

Experimental and unsupported

This option reads the call tiles from Teams' own page markup. Microsoft changes that markup often, sometimes only for some users or views, so the list may stop working or read wrong without notice, and fixes are not promised.

Set dbusControl.callParticipants to true (with dbusControl.enabled, restart required) to publish who is in the current call and who is speaking. It is off by default and applies to D-Bus only; MQTT never receives it.

callParticipants is null outside a call or when the option is off. In a call it is a JSON array sorted by name:

[{ "name": "Ada Lovelace", "speaking": true }, { "name": "Grace Hopper", "speaking": false }]

CallParticipantsChanged(s participantsJson) carries the same array (or null) whenever a name or a speaking flag changes. The stage is read every 500 ms, so a speaker change reaches the bus within about half a second.

What it covers, and what it does not:

  • Remote participants on the meeting stage. speaking follows the outline Teams draws around a tile while that person talks. Your own state is microphoneState (speaking, silent, muted).
  • The stage is read from the main window. With the Call Monitor (compact call view) open, the tiles stay there, so names and speaking flags keep updating.
  • People on another page of a large meeting's gallery are not listed. Names are the display names shown on the tiles, one entry per tile, so two people with the same name appear as two entries.
  • The values come from the Teams web page and follow its markup, so a Teams change can leave the list empty until this is updated. They are observations, not server data.

Names are personal data. They are never logged, and every client on your session bus can read them, so only enable this for local tools you trust, such as a meeting note taker that labels transcript lines with the speaker.

Examples​

Run in the same logged-in user session (no sudo):

BUS=com.github.IsmaelMartinez.teams_for_linux
OBJ_PATH=/com/github/IsmaelMartinez/teams_for_linux
IFACE=com.github.IsmaelMartinez.teams_for_linux.Control
busctl --user introspect "$BUS" "$OBJ_PATH" "$IFACE"
busctl --user call "$BUS" "$OBJ_PATH" "$IFACE" GetState
busctl --user call "$BUS" "$OBJ_PATH" "$IFACE" AcceptAudio
busctl --user call "$BUS" "$OBJ_PATH" "$IFACE" ToggleMute
busctl --user call "$BUS" "$OBJ_PATH" "$IFACE" SetStatus s busy
busctl --user call "$BUS" "$OBJ_PATH" "$IFACE" Mute b false
busctl --user call "$BUS" "$OBJ_PATH" "$IFACE" Unmute b false
busctl --user monitor "$BUS"
# with dbusControl.callParticipants: names and speaking flags as they change
dbus-monitor --session "type='signal',interface='$IFACE',member='CallParticipantsChanged'"

Writing a device bridge​

A headset, foot pedal or busy light can be wired to Teams through a small user service that sits between the device and this API, so device-specific code stays outside the application. A bridge built this way should account for the following behaviour.

Teams for Linux owns the bus name only while it runs. Watch NameOwnerChanged for the service name and call GetState whenever it gains an owner, since signals sent before the bridge connected or while the app was restarting are not replayed. When it loses its owner, treat the cached state as gone and return the device to idle (not ringing, on-hook), since an app that quits or crashes mid-call sends no final state.

When a call is answered, incomingCall can become false a moment before inCall becomes true, because the end of the ringing notification and the call connecting are reported separately. A bridge that keeps a line open while a call is active, such as a headset base that drops its off-hook state within about a second, should assert that state on the button press before calling AcceptAudio, keep it until inCall arrives, and clear it if the call returns false or inCall does not follow within a few seconds.

microphoneControlState is muted, unmuted or off (no active call), and unknown until the first observation. It is derived from the outgoing audio, so a microphone with built-in noise reduction that sends silence while you are quiet can read muted after about half a second; the MQTT microphone topic uses the same detection. Mute and Unmute rely on the same observation: they toggle only from a known muted or unmuted state (or with force set to true) and return false when the state already matches. On such a microphone a quiet, unmuted line can make Mute do nothing and Unmute send a toggle that mutes. Test this with your device before driving a mute LED from MicrophoneControlChanged or relying on Mute and Unmute; a bridge whose device has a single mute button can use ToggleMute, which sends the shortcut regardless of state.

A community example for EPOS/Sennheiser DECT bases is discussed in issue #3151. Its author published the HID headset bridge as a gist with the script, a systemd user service, a udev rule and the HID report layouts of the two devices tested; it is a third-party example, not maintained here.

Separate application instances​

For profiles launched in separate processes with different --user-data-dir directories, set a distinct dbusControl.busName in each directory's config.json, then restart those instances. For example:

{
"dbusControl": {
"enabled": true,
"busName": "com.github.IsmaelMartinez.teams_for_linux.Work"
}
}

Use com.github.IsmaelMartinez.teams_for_linux.Personal in the other instance. In the commands above, change only BUS to the chosen name; the object path and interface stay the same. Read each instance with GetState and subscribe to its signals by service name.

An empty or unset busName keeps the default. A custom name must be a well-known D-Bus name: at most 255 ASCII characters, at least two nonempty dot-separated components, using letters, digits, underscores or hyphens, with no component starting with a digit. Unique names such as :1.42 are not accepted. An invalid name disables the D-Bus service with a warning; it does not fall back to another name. Names are requested without queueing, so if two instances use the same name, only the first exposes the service.

This setting separates application processes. The built-in multi-account switcher still exposes one service per process and retains the selected-profile behavior described above.

Flatpak defaults to its app ID. A custom name overrides that default, but the sandbox must permit ownership of the chosen name; this setting does not grant permissions. The Snap packaging currently declares no D-Bus slot, so acquiring a name may be denied under Snap confinement. MQTT remains an independent, unchanged control and publishing path.