Skip to content

Commit

Permalink
Fallback to coturn default port if not port provided in uri
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Apr 21, 2024
1 parent 0d330a5 commit d57b58f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@ data class CoturnServer(
val username: String? = null,
val credential: String? = null,
) {
fun toUDPTransport() = TransportAddress(uri.host, uri.port, Transport.UDP)
companion object {
const val DEFAULT_PORT = 3478
}

fun toUDPTransport() = TransportAddress(
uri.host,
if(uri.port == -1) DEFAULT_PORT else uri.port,
Transport.UDP)
}

0 comments on commit d57b58f

Please sign in to comment.