Jump to content
PortSIP PBX for Unified Communications
Lehel Medves

Issue with initialization in swift

Recommended Posts


I have included the library and I have the following code:

let username = "1001"
        let displayName = "It is I"
        let password = "Ascom1234"
        let serverAddress = ""
        let serverPort: Int32 = 5060
        let transport = TRANSPORT_TCP
        let srtpPolicy = SRTP_POLICY_NONE
        let localIPAddress = ""
        let localPort: Int32 = 10002
        let logLevel = PORTSIP_LOG_NONE
        let licenseKey = "PORTSIP_TEST_LICENSE"
        let initializationResult = portSIPSDK.initialize(
            localIP: localIPAddress,
            localSIPPort: localPort,
            loglevel: logLevel,
            logPath: "",
            maxLine: 8,
            agent: Device.shared.getAppName(),
            audioDeviceLayer: 0,
            videoDeviceLayer: 0,
            tlsCertificatesRootPath: "",
            tlsCipherList: "",
            verifyTLSCertificate: false
        guard initializationResult == 0 else {
            print("Error initializing PortSIP: \(initializationResult)")

This produces a runtime error: +[UIDevice deviceType]: unrecognized selector sent to class 0x1f26aba98

What am I doing wrong?


Thanks and regards,

Share this post

Link to post
Share on other sites
1 hour ago, Lehel Medves said:

Found the issue, simple the -objC linker flag needed to be added to the Build Settings.

Good to know it solved.


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...