AppSipController class

A singleton controller responsible for managing SIP registration, WebRTC streams, call states, and UI overlays.

This controller acts as a high-level service layer on top of SipControllerBloc and exposes convenient ValueNotifiers for the UI to listen to in real-time.

Key Responsibilities:

  • Initialize and manage the SIP stack
  • Handle outgoing and incoming calls
  • Manage local/remote media streams
  • Provide formatted call duration
  • Show and hide the full-screen call overlay
  • Wraps and triggers Bloc events for SIP logic

This class is intended to be used as:

AppSipController.instance.register(...);
AppSipController.instance.makeCall();

It should persist during the app lifecycle.

Properties

callDuration ValueNotifier<String>
Displays the formatted call duration (mm:ss).
final
callState ValueNotifier<int>
Call state indicator (custom int mapped to internal states).
final
currentCall ValueNotifier<Call?>
Holds the current active SIP call.
final
hashCode int
The hash code for this object.
no setterinherited
localStream ValueNotifier<MediaStream?>
Provides the local WebRTC media stream.
final
remoteStream ValueNotifier<MediaStream?>
Provides the remote WebRTC media stream.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sipData ValueNotifier<SipConfigModel>
The active SIP configuration currently in use.
final
sipStarted ValueNotifier<bool>
Indicates whether SIP registration has completed successfully.
final

Methods

disableMicrophone() → void
Alias for disabling the microphone.
disableVoiceCallMode() → void
Disables voice call audio mode.
dispose() → void
Cleans up resources and closes streams.
enableMicrophone() → void
Alias for enabling the microphone.
enableVoiceCallMode() → void
Enables voice call audio mode.
endCall() → void
Ends the current active call.
hideCallOverlay() → void
Hides the overlay previously shown via showCallOverlay.
init() → void
Initializes listeners for the underlying BLoC.
makeCall([String? target]) → void
Initiates an outgoing SIP call.
muteMicrophone() → void
Mutes the microphone.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register({String? displayName, String? sipServer, String? wsServer, String? authUsername, String? username, String? password, String? callTo, String? callToAlias, bool? keyboard}) → void
Registers the SIP client with the provided settings.
sendDtmf(String key) → void
Sends a DTMF tone during an active call.
showCallOverlay() → void
Displays the full-screen call overlay UI.
startLocalStream() → void
Starts capturing the local media stream.
stopLocalStream() → void
Stops capturing the local media stream.
toString() String
A string representation of this object.
inherited
unmuteMicrophone() → void
Unmutes the microphone.
unRegister() → void
Unregisters from the SIP server.

Operators

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

Static Properties

instance AppSipController
The single instance of AppSipController.
final