PortsipPlatform class abstract
Abstract platform interface for the PortSIP Flutter plugin.
This class defines the contract for platform-specific implementations of the PortSIP VoIP SDK. It provides methods for SIP registration, call management, and audio/video controls.
Platform-specific implementations (iOS and Android) extend this class and provide their native implementations via method channels.
- Inheritance
-
- Object
- PlatformInterface
- PortsipPlatform
- Implementers
Constructors
- PortsipPlatform()
- Constructs a PortsipPlatform.
Properties
-
events
→ Stream<
PortsipEvent> -
Returns a broadcast stream of PortSIP SDK events.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
configureCallKit(
{required String appName, bool canUseCallKit = true, String? iconTemplateImageName}) → Future< void> - Configures CallKit provider with app name and settings (iOS only).
-
configureConnectionService(
{required String appName, bool canUseConnectionService = true}) → Future< int> - Configures ConnectionService with app name and settings (Android only).
-
createAudioConference(
) → Future< int> - Creates an audio conference bridge. Joined sessions are mixed together.
-
destroyConference(
) → Future< int> - Destroys the existing conference bridge.
-
dispose(
) → Future< void> - Disposes of all SDK resources and cleans up.
-
enable3GppTags(
{required bool enable}) → Future< int> - Enables or disables 3GPP tags in SIP messages.
-
enableAEC(
{required bool enable}) → Future< int> - Enables or disables Acoustic Echo Cancellation (AEC).
-
enableAGC(
{required bool enable}) → Future< int> - Enables or disables Automatic Gain Control (AGC).
-
enableANS(
{required bool enable}) → Future< int> - Enables or disables Automatic Noise Suppression (ANS).
-
enableAudioManager(
{required bool enable}) → Future< int> - Enables or disables the audio manager.
-
enableCallKit(
{required bool enabled}) → Future< void> - Enables or disables CallKit integration at runtime (iOS only).
-
enableCNG(
{required bool enable}) → Future< int> - Enables or disables Comfort Noise Generation (CNG).
-
enableConnectionService(
{required bool enabled}) → Future< int> - Enables or disables ConnectionService at runtime (Android only).
-
enableSessionTimer(
{int timerSeconds = 90, int refreshMode = 0}) → Future< int> - Enables SIP session timers (RFC 4028) for subsequent calls so the server reaps a dead leg at expiry when the client stops refreshing.
-
enableVAD(
{required bool enable}) → Future< int> - Enables or disables Voice Activity Detection (VAD).
-
endCallAndResume(
{required int endSessionId, required int resumeSessionId}) → Future< int> -
Ends
endSessionIdand resumesresumeSessionIdatomically, keeping exactly one active call in the system call UI. -
getStatistics(
{required int sessionId}) → Future< int> -
Requests RTP media statistics for
sessionId. The result is delivered asynchronously through the events stream as anonStatisticsevent whosestatfield is a JSON string of the channel statistics (bytes, packets, jitter, loss). Call periodically (e.g. once per second) to track data usage of an ongoing call. -
hangUp(
{required int sessionId, bool reportToConnectionService = true}) → Future< int> - Terminates an active call.
-
hold(
{required int sessionId}) → Future< int> - Puts a call on hold.
-
initialize(
{required TransportType transport, required String localIP, required int localSIPPort, required PortsipLogLevel logLevel, required String logFilePath, required int maxCallLines, required String sipAgent, required int audioDeviceLayer, required int videoDeviceLayer, required String tlsCertificatesRootPath, required String tlsCipherList, required bool verifyTLSCertificate, required String dnsServers, int ptime = 20, int maxPtime = 60}) → Future< int> - Initializes the PortSIP SDK with the provided configuration.
-
joinToConference(
{required int sessionId}) → Future< int> - Joins a session into the existing conference. The session must not be on hold (un-hold first).
-
makeCall(
{required String callee, required bool sendSdp, required bool videoCall, bool reportToConnectionService = true, String? displayName}) → Future< int> - Initiates an outgoing call to the specified callee.
-
muteSession(
{required int sessionId, required bool muteIncomingAudio, required bool muteOutgoingAudio, required bool muteIncomingVideo, required bool muteOutgoingVideo}) → Future< int> - Mutes or unmutes audio/video streams for a call session.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshRegistration(
{int expires = 0}) → Future< int> - Refreshes the registration with the SIP server.
-
register(
{required SipAccount account}) → Future< int> - Configures the SIP account credentials and server settings.
-
registerServer(
{int registerTimeout = 120, int registerRetryTimes = 3}) → Future< int> - Registers with the SIP server.
-
removeFromConference(
{required int sessionId}) → Future< int> - Removes a session from the existing conference.
-
reportConferenceMerged(
{required int primarySessionId, required List< int> mergedAwaySessionIds}) → Future<int> - Collapses a merged conference to a single system call by ending the CallKit / ConnectionService calls for the merged-away legs.
-
requestCallGroup(
{required List< int> sessionIds}) → Future<int> - Groups the given sessions into one native conference call in the system call UI. No call is ended; the onCallKitMerge event signals the host to build the audio bridge.
-
sendDtmf(
{required int sessionId, required int dtmf, required bool playDtmfTone, int dtmfMethod = 0, int dtmfDuration = 160}) → Future< int> - Sends a DTMF (Dual-Tone Multi-Frequency) tone during a call.
-
setAudioCodecs(
{required List< AudioCodec> audioCodecs}) → Future<int> - Configures audio codecs for the SIP session.
-
setLicenseKey(
{required String licenseKey}) → Future< int> - Sets the PortSIP license key.
-
setLogsEnabled(
{required bool enabled}) → void - Enables or disables plugin debug logging.
-
setLoudspeakerStatus(
{required bool enable}) → Future< int> - Enables or disables the loudspeaker (speakerphone).
-
setSrtpPolicy(
{required int policy}) → Future< int> - Sets the SRTP (Secure Real-time Transport Protocol) policy.
-
swapHold(
{required int holdSessionId, required int unholdSessionId}) → Future< int> -
Swaps which of two calls is on hold: holds
holdSessionId, resumesunholdSessionId, and mirrors both to the system call UI atomically. -
toString(
) → String -
A string representation of this object.
inherited
-
unHold(
{required int sessionId}) → Future< int> - Resumes a call that was previously put on hold.
-
unInitialize(
) → Future< void> - Tears down the native SDK so a different user can be loaded via initialize + register again, without shutting down the plugin.
-
unRegister(
) → Future< void> - Unregisters the SIP account from the SIP server.
-
updateCall(
{required int sessionId, bool enableAudio = true, bool enableVideo = false}) → Future< int> - Updates an active call session (sends a re-INVITE) to renegotiate the media streams — e.g. after a network change to re-anchor media to the new interface.
-
updateOsCallDisplay(
{required int sessionId, required String displayName}) → Future< int> - Updates the display name the system call UI (CallKit / ConnectionService) shows for a session's call.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ PortsipPlatform
-
The default instance of PortsipPlatform to use.
getter/setter pair