Commit 08730df0 authored by Youness Alaoui's avatar Youness Alaoui
Browse files

Give the turn agent the long term credentials flag it needs

parent b0918b6e
......@@ -438,7 +438,8 @@ discovery_add_relay_candidate (
if (nice_udp_turn_create_socket_full (&agent->relay_socket_factory,
relay_socket, address, base_socket, &component->turn_server,
component->turn_username, component->turn_password,
priv_agent_to_udp_turn_compatibility (agent))) {
priv_agent_to_udp_turn_compatibility (agent),
component->turn_long_term)) {
candidate->sockptr = relay_socket;
candidate->base_addr = base_socket->addr;
......
......@@ -244,20 +244,21 @@ nice_udp_turn_create_socket_full (
NiceAddress *server_addr,
gchar *username,
gchar *password,
NiceUdpTurnSocketCompatibility compatibility)
NiceUdpTurnSocketCompatibility compatibility,
gboolean long_term)
{
turn_priv *priv = g_new0 (turn_priv, 1);
if (compatibility == NICE_UDP_TURN_SOCKET_COMPATIBILITY_DRAFT9) {
stun_agent_init (&priv->agent, STUN_ALL_KNOWN_ATTRIBUTES,
STUN_COMPATIBILITY_3489BIS,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS |
STUN_AGENT_USAGE_IGNORE_CREDENTIALS);
long_term ? STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS :
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS);
} else {
stun_agent_init (&priv->agent, STUN_ALL_KNOWN_ATTRIBUTES,
STUN_COMPATIBILITY_RFC3489,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS |
STUN_AGENT_USAGE_IGNORE_CREDENTIALS);
long_term ? STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS :
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS);
}
priv->locked = FALSE;
......
......@@ -67,7 +67,8 @@ nice_udp_turn_create_socket_full (
NiceAddress *server_addr,
gchar *username,
gchar *password,
NiceUdpTurnSocketCompatibility compatibility);
NiceUdpTurnSocketCompatibility compatibility,
gboolean long_term);
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment