initialize method

Future<int> initialize({
  1. required TransportType transport,
  2. required String localIP,
  3. required int localSIPPort,
  4. required PortsipLogLevel logLevel,
  5. required String logFilePath,
  6. required int maxCallLines,
  7. required String sipAgent,
  8. required int audioDeviceLayer,
  9. required int videoDeviceLayer,
  10. required String tlsCertificatesRootPath,
  11. required String tlsCipherList,
  12. required bool verifyTLSCertificate,
  13. required String dnsServers,
  14. int ptime = 20,
  15. int maxPtime = 60,
})

Initializes the PortSIP SDK with the provided configuration.

This method must be called before any other PortSIP SDK operations.

Parameters:

  • transport: The SIP transport protocol (UDP, TCP, or TLS)
  • localIP: The local IP address to bind (use "0.0.0.0" for auto-detect)
  • localSIPPort: The local SIP port to listen on
  • logLevel: The logging level for the SDK
  • logFilePath: The directory path where SDK logs will be saved
  • maxCallLines: Maximum number of concurrent call lines
  • sipAgent: The User-Agent string for SIP messages
  • audioDeviceLayer: Audio device layer (0 for default)
  • videoDeviceLayer: Video device layer (0 for default)
  • tlsCertificatesRootPath: Root path for TLS certificates
  • tlsCipherList: TLS cipher list configuration
  • verifyTLSCertificate: Whether to verify TLS certificates
  • dnsServers: Comma-separated DNS server addresses
  • ptime: Audio packet time in milliseconds (default: 20)
  • maxPtime: Maximum audio packet time in milliseconds (default: 60)

Returns 0 on success, negative error code on failure.

Implementation

Future<int> 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,
}) async {
  throw UnimplementedError('initialize has not been implemented.');
}