Skip to content

Commit

Permalink
Change default stun server
Browse files Browse the repository at this point in the history
  • Loading branch information
getroot committed Jul 29, 2022
1 parent 407f2b9 commit 86e9bbf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion misc/conf_examples/Edge.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
This is useful when OME cannot obtain a public IP from an interface, such as AWS or docker environment.
If this is successful, you can use ${PublicIP} in your settings.
-->
<StunServer>stun.l.google.com:19302</StunServer>
<StunServer>stun.ovenmediaengine.com:13478</StunServer>

<Modules>
<!--
Expand Down
2 changes: 1 addition & 1 deletion misc/conf_examples/Origin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
This is useful when OME cannot obtain a public IP from an interface, such as AWS or docker environment.
If this is successful, you can use ${PublicIP} in your settings.
-->
<StunServer>stun.l.google.com:19302</StunServer>
<StunServer>stun.ovenmediaengine.com:13478</StunServer>

<Modules>
<!--
Expand Down
2 changes: 1 addition & 1 deletion misc/conf_examples/Server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
This is useful when OME cannot obtain a public IP from an interface, such as AWS or docker environment.
If this is successful, you can use ${PublicIP} in your settings.
-->
<StunServer>stun.l.google.com:19302</StunServer>
<StunServer>stun.ovenmediaengine.com:13478</StunServer>

<Modules>
<!--
Expand Down
8 changes: 8 additions & 0 deletions src/projects/modules/ice/stun_client.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "stun_client.h"
#include "stun/stun_message.h"
#include "stun/attributes/stun_xor_mapped_address_attribute.h"
#include "stun/attributes/stun_realm_attribute.h"
#include "stun/attributes/stun_software_attribute.h"

#include <main/main.h>

#define OV_LOG_TAG "StunClient"

Expand All @@ -21,6 +25,10 @@ bool StunClient::GetMappedAddress(const ov::SocketAddress &stun_server, ov::Sock
}
message.SetTransactionId(&(transaction_id[0]));

auto software_attribute = std::make_shared<StunSoftwareAttribute>();
software_attribute->SetText(ov::String::FormatString("OvenMediaEngine v%s", OME_VERSION));
message.AddAttribute(software_attribute);

auto send_data = message.Serialize();

auto client = ov::SocketPool::GetUdpPool()->AllocSocket();
Expand Down

0 comments on commit 86e9bbf

Please sign in to comment.