MethodChannelPortsip class

Method channel implementation of PortsipPlatform.

This class provides the concrete implementation of the PortSIP platform interface using Flutter's MethodChannel for communication with native iOS and Android code.

Events from the native side are received via method calls from native to Flutter, which are dispatched via a broadcast StreamController to allow multiple listeners.

Inheritance

Constructors

MethodChannelPortsip()
Creates a new MethodChannelPortsip instance.

Properties

events → Stream<PortsipEvent>
Returns a broadcast stream of PortSIP SDK events.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
methodChannel → MethodChannel
The method channel used to interact with the native platform.
final
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 (iOS only).
override
configureConnectionService({required String appName, bool canUseConnectionService = true}) → Future<int>
Configures ConnectionService with app name and settings (Android only).
override
createAudioConference() → Future<int>
Creates an audio conference bridge.
override
destroyConference() → Future<int>
Destroys the existing conference bridge.
override
dispose() → Future<void>
Disposes of all SDK resources and cleans up.
override
enable3GppTags({required bool enable}) → Future<int>
Enables or disables 3GPP tags in SIP messages.
override
enableAEC({required bool enable}) → Future<int>
Enables or disables Acoustic Echo Cancellation (AEC).
override
enableAGC({required bool enable}) → Future<int>
Enables or disables Automatic Gain Control (AGC).
override
enableANS({required bool enable}) → Future<int>
Enables or disables Automatic Noise Suppression (ANS).
override
enableAudioManager({required bool enable}) → Future<int>
Enables or disables the audio manager.
override
enableAudioQos({required bool enable}) → Future<int>
Enables/disables QoS DSCP marking on the audio channel.
override
enableCallbackSignaling({required bool sending, required bool received}) → Future<int>
Enables/disables the SDK's SIP message callbacks, which mirror sent and received SIP messages into the platform logs.
override
enableCallKit({required bool enabled}) → Future<void>
Enables or disables CallKit at runtime (iOS only).
override
enableCNG({required bool enable}) → Future<int>
Enables or disables Comfort Noise Generation (CNG).
override
enableConnectionService({required bool enabled}) → Future<int>
Enables or disables ConnectionService at runtime (Android only).
override
enableSessionTimer({int timerSeconds = 90, int refreshMode = 0}) → Future<int>
Enables SIP session timers (RFC 4028).
override
enableVAD({required bool enable}) → Future<int>
Enables or disables Voice Activity Detection (VAD).
override
endCallAndResume({required int endSessionId, required int resumeSessionId}) → Future<int>
Ends one leg and resumes another atomically (keeps one active system call).
override
getStatistics({required int sessionId}) → Future<int>
Requests RTP statistics for a session; the result arrives as an onStatistics event on the events stream.
override
hangUp({required int sessionId, bool reportToConnectionService = true}) → Future<int>
Terminates an active call.
override
hold({required int sessionId}) → Future<int>
Puts a call on hold.
override
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.
override
joinToConference({required int sessionId}) → Future<int>
Joins a session into the existing conference.
override
makeCall({required String callee, required bool sendSdp, required bool videoCall, bool reportToConnectionService = true, String? displayName}) → Future<int>
Initiates an outgoing call.
override
muteSession({required int sessionId, required bool muteIncomingAudio, required bool muteOutgoingAudio, required bool muteIncomingVideo, required bool muteOutgoingVideo}) → Future<int>
Mutes or unmutes audio/video streams.
override
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.
override
register({required SipAccount account}) → Future<int>
Configures SIP account credentials and server settings.
override
registerServer({int registerTimeout = 120, int registerRetryTimes = 3}) → Future<int>
Registers with the SIP server.
override
removeFromConference({required int sessionId}) → Future<int>
Removes a session from the existing conference.
override
reportConferenceMerged({required int primarySessionId, required List<int> mergedAwaySessionIds}) → Future<int>
Collapses a merged conference to a single system call.
override
requestCallGroup({required List<int> sessionIds}) → Future<int>
Groups the given sessions into one native conference call.
override
sendDtmf({required int sessionId, required int dtmf, required bool playDtmfTone, int dtmfMethod = 0, int dtmfDuration = 160}) → Future<int>
Sends a DTMF tone during an active call.
override
setAudioCodecs({required List<AudioCodec> audioCodecs}) → Future<int>
Configures audio codecs for the SIP session.
override
setAudioRoute({required String kind}) → Future<int>
Routes the current call's audio to a specific output (Android, Telecom-owned).
override
setLicenseKey({required String licenseKey}) → Future<int>
Sets the PortSIP license key.
override
setLogsEnabled({required bool enabled}) → void
Enables or disables debug logging for the plugin.
override
setLoudspeakerStatus({required bool enable}) → Future<int>
Enables or disables loudspeaker.
override
setSrtpPolicy({required int policy}) → Future<int>
Sets the SRTP (Secure Real-time Transport Protocol) policy.
override
startPcmRecord({required int sessionId, required String recordFilePath, required String recordFileName}) → Future<int>
Writes a session's raw audio stream to WAVE files.
override
startPlayingFileToRemote({required int sessionId, required String fileUrl, bool loop = false, PortsipPlayFileAudioMode playAudio = PortsipPlayFileAudioMode.mixedWithMicrophone}) → Future<int>
Plays a file into the stream sent to the remote party.
override
startRecord({required int sessionId, required String recordFilePath, required String recordFileName, bool appendTimeStamp = false, int audioChannels = 1, PortsipRecordFileFormat fileFormat = PortsipRecordFileFormat.wave, PortsipRecordMode audioRecordMode = PortsipRecordMode.both, PortsipRecordMode videoRecordMode = PortsipRecordMode.none}) → Future<int>
Starts recording the call on a session.
override
stopPcmRecord({required int sessionId}) → Future<String?>
Stops the raw-audio recording on a session.
override
stopPlayingFileToRemote({required int sessionId}) → Future<int>
Stops the file playback running on a session.
override
stopRecord({required int sessionId}) → Future<int>
Stops the recording running on a session.
override
swapHold({required int holdSessionId, required int unholdSessionId}) → Future<int>
Swaps which of two calls is on hold (atomic system-call mirror).
override
toString() → String
A string representation of this object.
inherited
unHold({required int sessionId}) → Future<int>
Resumes a held call.
override
unInitialize() → Future<void>
Tears down the native SDK while keeping the plugin (and its event stream) alive. Used to swap SIP users at runtime.
override
unRegister() → Future<void>
Unregisters the SIP account from the server. The SDK remains initialized and the account can be re-registered later.
override
updateCall({required int sessionId, bool enableAudio = true, bool enableVideo = false}) → Future<int>
Updates an active call session (sends a re-INVITE).
override
updateOsCallDisplay({required int sessionId, required String displayName}) → Future<int>
Updates the display name the system call UI shows for a session.
override

Operators

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