diff --git a/agent/agent.c b/agent/agent.c index 35f2764251f9d145e40338ebff16429f6edcd5ec..5fef0921b3ecbaf75b1b3fb67e06caa189cbff95 100644 --- a/agent/agent.c +++ b/agent/agent.c @@ -4817,3 +4817,28 @@ nice_agent_get_io_stream (NiceAgent *agent, guint stream_id, return iostream; } + +NICEAPI_EXPORT gboolean +nice_agent_forget_relays (NiceAgent *agent, guint stream_id, guint component_id) +{ + Component *component; + gboolean ret = TRUE; + + g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE); + g_return_val_if_fail (stream_id >= 1, FALSE); + g_return_val_if_fail (component_id >= 1, FALSE); + + agent_lock (); + + if (!agent_find_component (agent, stream_id, component_id, NULL, &component)) { + ret = FALSE; + goto done; + } + + component_clean_turn_servers (component); + + done: + agent_unlock_and_emit (agent); + + return ret; +} diff --git a/agent/agent.h b/agent/agent.h index 8ffa3a03453b3806de4e6937e256b5edaceeeee2..f0b7ee5313c5148eadec1f403ae37bdc0e1e68cb 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -1447,6 +1447,26 @@ nice_agent_get_io_stream ( const gchar * nice_component_state_to_string (NiceComponentState state); +/** + * nice_agent_forget_relays: + * @agent: The #NiceAgent Object + * @stream_id: The ID of the stream + * @component_id: The ID of the component + * + * Forget all the relay servers previously added using + * nice_agent_set_relay_info(). Currently connected streams will keep + * using the relay as long as they have not been restarted and haven't + * succesfully negotiated a different path. + * + * Returns: %FALSE if the component could not be found, %TRUE otherwise + * + * Since: 0.1.6 + */ +gboolean +nice_agent_forget_relays (NiceAgent *agent, + guint stream_id, + guint component_id); + G_END_DECLS #endif /* _AGENT_H */ diff --git a/docs/reference/libnice/libnice-sections.txt b/docs/reference/libnice/libnice-sections.txt index edbdeef989f291f530122e321973015af8e6bfca..856dc6b9f2366ab3d9f743b0d3706dd34109443e 100644 --- a/docs/reference/libnice/libnice-sections.txt +++ b/docs/reference/libnice/libnice-sections.txt @@ -17,6 +17,7 @@ nice_agent_set_port_range nice_agent_add_stream nice_agent_remove_stream nice_agent_set_relay_info +nice_agent_forget_relays nice_agent_gather_candidates nice_agent_set_remote_credentials nice_agent_get_local_credentials diff --git a/nice/libnice.sym b/nice/libnice.sym index b2c92ca740f7375c4a52da5f890665c433bc34be..2f0ef3086651d2b711bf3743c643407274dd42ed 100644 --- a/nice/libnice.sym +++ b/nice/libnice.sym @@ -21,6 +21,7 @@ nice_agent_recv_messages nice_agent_recv_nonblocking nice_agent_recv_messages_nonblocking nice_agent_attach_recv +nice_agent_forget_relays nice_agent_gather_candidates nice_agent_generate_local_candidate_sdp nice_agent_generate_local_sdp diff --git a/win32/vs9/libnice.def b/win32/vs9/libnice.def index 1ab13174429ce86ca55fbe18bdc7ebfe45c8a2a8..1faebc28b10cb3bdbf6beea850089b29c7e41c4b 100644 --- a/win32/vs9/libnice.def +++ b/win32/vs9/libnice.def @@ -21,6 +21,7 @@ nice_address_to_string nice_agent_add_local_address nice_agent_add_stream nice_agent_attach_recv +nice_agent_forget_relays nice_agent_gather_candidates nice_agent_generate_local_candidate_sdp nice_agent_generate_local_sdp