1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

webrtc: Use UUID name as signaling peer by default

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
This commit is contained in:
Steffen Vogel 2023-06-30 10:51:40 +02:00
parent 7749a3a922
commit 4d43b72d78
2 changed files with 6 additions and 4 deletions

View file

@ -33,6 +33,11 @@ WebRTCNode::WebRTCNode(const uuid_t &id, const std::string &name) :
dci({})
{
dci.reliability.type = rtc::Reliability::Type::Rexmit;
// Initialize signaling peer with node UUID
char uuid_str[36+1];
uuid_unparse(id, uuid_str);
peer = uuid_str;
}
WebRTCNode::~WebRTCNode()

View file

@ -31,13 +31,10 @@ SignalingClient::SignalingClient(const std::string &server, const std::string &s
memset(&info, 0, sizeof(info));
ret = asprintf(&uri, "%s/%s", server.c_str(), session.c_str());
ret = asprintf(&uri, "%s/%s/%s", server.c_str(), session.c_str(), peer.c_str());
if (ret < 0)
throw RuntimeError { "Could not format signaling server uri" };
if (!peer.empty())
strcatf(&uri, "/%s", peer.c_str());
ret = lws_parse_uri(uri, &prot, &a, &info.port, &p);
if (ret)
throw RuntimeError("Failed to parse WebSocket URI: '{}'", uri);