Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the transport protocol really change? #472

Open
MohammadHuseyn opened this issue Feb 2, 2025 · 0 comments
Open

Does the transport protocol really change? #472

MohammadHuseyn opened this issue Feb 2, 2025 · 0 comments

Comments

@MohammadHuseyn
Copy link

MohammadHuseyn commented Feb 2, 2025

hi
I am using "linphone sdk 5.3.100" for programming an android application.
is there any way to change the transport protocol during using a core?
i found two options:

  1. change transport port for each protocol from Core - looks like you can set the default core protocol and the port that it will use.
  2. change transport protocol for an account via account params

Implementation

so i use this function in kotlin:

    private fun setTransport(transport: String) {
        val core = getLinphoneCore() ?: return  // Ensure core is not null
        val transports = core.transports  // Get the Transports object directly
        val account: Account? = core.getDefaultAccount()
        if (account != null) {
            val params: AccountParams = account.getParams()
            when (transport) {
                "udp" -> {
                    transports.setUdpPort(5060)
                    params.setTransport(TransportType.Udp)
                }  // Enable UDP
                "tcp" -> {
                    transports.setTcpPort(5060)
                    params.setTransport(TransportType.Tcp)

                }  // Enable TCP
                "tls" -> {
                    transports.setTlsPort(5061)
                    params.setTransport(TransportType.Tls)

                }  // Enable TLS
                else -> {
                    transports.setUdpPort(5060)
                    params.setTransport(TransportType.Udp)

                }   // Default to UDP if invalid input
            }

            transports.dtlsPort = 0  // Disable DTLS explicitly
            core.setTransports(transports) // Apply the updated transport settings
        }
    }

Notes

  1. there is always one account
  2. the input is "udp", "tcp" or "tls"
  3. no matter what I set the transport with this function, the application will always use UDP (confirmed with Wireshark)
  4. I tried this before registration and after registration, both failed
  5. to confirm that the bug is not with the input of the function, i changed the "else" in the function to connect via TCP, it used UDP again.

Questions

  1. Is it the correct way to change transport?
  2. is it possible to change transport protocol with an initiated core?
  3. Does the related functions work in real time and the core use the real time set protocol?
    I dont know what logs to attach here, eveything works and the code does not generate any specific log, if anything needed plz tell me
    thanks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant