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
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
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
enableVAD({required bool enable}) Future<int>
Enables or disables Voice Activity Detection (VAD).
override
hangUp({required int sessionId}) 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
makeCall({required String callee, required bool sendSdp, required bool videoCall}) 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
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
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
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
toString() String
A string representation of this object.
inherited
unHold({required int sessionId}) Future<int>
Resumes a held call.
override
unRegister() Future<void>
Unregisters from SIP server and releases resources.
override

Operators

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