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

Add support for STUN/TURN FQDN addresses #9

Merged
merged 3 commits into from
Mar 16, 2021
Merged

Add support for STUN/TURN FQDN addresses #9

merged 3 commits into from
Mar 16, 2021

Conversation

mickel8
Copy link
Member

@mickel8 mickel8 commented Mar 15, 2021

closes #8

@mickel8 mickel8 added the enhancement New feature or request label Mar 15, 2021
@mickel8 mickel8 requested a review from mat-hek March 15, 2021 15:57
@mickel8 mickel8 self-assigned this Mar 15, 2021
Copy link
Member

@mat-hek mat-hek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix CI

Comment on lines 571 to 604
case lookup_addr(server_addr) do
{:error, cause} = error ->
Logger.warn("""
Couldn't set TURN server #{inspect(server_ip)} #{inspect(server_port)} \
Couldn't set TURN server #{inspect(server_addr)} #{inspect(server_port)} \
#{inspect(relay_type)} for component: #{inspect(component_id)} in stream: \
#{inspect(stream_id)}, cause: #{inspect(cause)}
""")

error

{:ok, server_ip} ->
case Unifex.CNode.call(cnode, :set_relay_info, [
stream_id,
component_id,
:inet.ntoa(server_ip) |> to_string(),
server_port,
username,
password,
Atom.to_string(relay_type)
]) do
:ok ->
:ok

{:error, cause} = error ->
Logger.warn("""
Couldn't set TURN server #{inspect(server_addr)} #{inspect(server_port)} \
#{inspect(relay_type)} for component: #{inspect(component_id)} in stream: \
#{inspect(stream_id)}, cause: #{inspect(cause)}
""")

error
end
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please avoid nested cases, use with or withl

@mickel8 mickel8 requested a review from mat-hek March 16, 2021 12:04
@mickel8 mickel8 merged commit 856ebd3 into master Mar 16, 2021
@mickel8 mickel8 deleted the fqdn branch March 16, 2021 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support passing STUN servers via FQDN
2 participants