Source

Target

Commits (1)
Showing with 186 additions and 6 deletions
......@@ -8759,7 +8759,7 @@ const char *linphone_core_get_srtp_crypto_suites(LinphoneCore *core) {
return linphone_config_get_string(core->config, "sip", "srtp_crypto_suites", "AES_CM_128_HMAC_SHA1_80, AES_CM_128_HMAC_SHA1_32, AES_256_CM_HMAC_SHA1_80, AES_256_CM_HMAC_SHA1_32");
}
LinphoneConferenceInfo *linphone_core_get_conference_information_from_uri(LinphoneCore *core, LinphoneAddress *uri) {
LinphoneConferenceInfo *linphone_core_find_conference_information_from_uri(LinphoneCore *core, LinphoneAddress *uri) {
#ifdef HAVE_DB_STORAGE
auto &mainDb = L_GET_PRIVATE_FROM_C_OBJECT(core)->mainDb;
auto confInfo = mainDb->getConferenceInfoFromURI(ConferenceAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(uri)));
......
......@@ -162,34 +162,66 @@ void linphone_nat_policy_clear(LinphoneNatPolicy *policy) {
}
bool_t linphone_nat_policy_stun_enabled(const LinphoneNatPolicy *policy) {
return linphone_nat_policy_is_stun_enabled(policy);
}
bool_t linphone_nat_policy_is_stun_enabled(const LinphoneNatPolicy *policy) {
return policy->stun_enabled;
}
void linphone_nat_policy_enable_stun(LinphoneNatPolicy *policy, bool_t enable) {
linphone_nat_policy_set_stun_enabled(policy, enable);
}
void linphone_nat_policy_set_stun_enabled(LinphoneNatPolicy *policy, bool_t enable) {
policy->stun_enabled = enable;
}
bool_t linphone_nat_policy_turn_enabled(const LinphoneNatPolicy *policy) {
return linphone_nat_policy_is_turn_enabled(policy);
}
bool_t linphone_nat_policy_is_turn_enabled(const LinphoneNatPolicy *policy) {
return policy->turn_enabled;
}
void linphone_nat_policy_enable_turn(LinphoneNatPolicy *policy, bool_t enable) {
linphone_nat_policy_set_turn_enabled(policy, enable);
}
void linphone_nat_policy_set_turn_enabled(LinphoneNatPolicy *policy, bool_t enable) {
policy->turn_enabled = enable;
}
bool_t linphone_nat_policy_ice_enabled(const LinphoneNatPolicy *policy) {
return linphone_nat_policy_is_ice_enabled(policy);
}
bool_t linphone_nat_policy_is_ice_enabled(const LinphoneNatPolicy *policy) {
return policy->ice_enabled;
}
void linphone_nat_policy_enable_ice(LinphoneNatPolicy *policy, bool_t enable) {
linphone_nat_policy_set_ice_enabled(policy, enable);
}
void linphone_nat_policy_set_ice_enabled(LinphoneNatPolicy *policy, bool_t enable) {
policy->ice_enabled = enable;
}
bool_t linphone_nat_policy_upnp_enabled(const LinphoneNatPolicy *policy) {
return linphone_nat_policy_is_upnp_enabled(policy);
}
bool_t linphone_nat_policy_is_upnp_enabled(const LinphoneNatPolicy *policy) {
return policy->upnp_enabled;
}
void linphone_nat_policy_enable_upnp(LinphoneNatPolicy *policy, bool_t enable) {
linphone_nat_policy_set_upnp_enabled(policy, enable);
}
void linphone_nat_policy_set_upnp_enabled(LinphoneNatPolicy *policy, bool_t enable) {
policy->upnp_enabled = enable;
if (enable) {
ms_warning("uPnP NAT policy is no longer supported");
......@@ -369,26 +401,50 @@ LinphoneNatPolicy * linphone_core_create_nat_policy_from_config(LinphoneCore *lc
}
void linphone_nat_policy_enable_udp_turn_transport(LinphoneNatPolicy *policy, bool_t enable) {
linphone_nat_policy_set_udp_turn_transport_enabled(policy, enable);
}
void linphone_nat_policy_set_udp_turn_transport_enabled(LinphoneNatPolicy *policy, bool_t enable) {
policy->turn_udp_enabled = enable;
}
bool_t linphone_nat_policy_udp_turn_transport_enabled(LinphoneNatPolicy *policy) {
return linphone_nat_policy_is_udp_turn_transport_enabled(policy);
}
bool_t linphone_nat_policy_is_udp_turn_transport_enabled(LinphoneNatPolicy *policy) {
return policy->turn_udp_enabled;
}
void linphone_nat_policy_enable_tcp_turn_transport(LinphoneNatPolicy *policy, bool_t enable) {
linphone_nat_policy_set_tcp_turn_transport_enabled(policy, enable);
}
void linphone_nat_policy_set_tcp_turn_transport_enabled(LinphoneNatPolicy *policy, bool_t enable) {
policy->turn_tcp_enabled = enable;
}
bool_t linphone_nat_policy_tcp_turn_transport_enabled(LinphoneNatPolicy *policy) {
return linphone_nat_policy_is_tcp_turn_transport_enabled(policy);
}
bool_t linphone_nat_policy_is_tcp_turn_transport_enabled(LinphoneNatPolicy *policy) {
return policy->turn_tcp_enabled;
}
void linphone_nat_policy_enable_tls_turn_transport(LinphoneNatPolicy *policy, bool_t enable) {
linphone_nat_policy_set_tls_turn_transport_enabled(policy, enable);
}
void linphone_nat_policy_set_tls_turn_transport_enabled(LinphoneNatPolicy *policy, bool_t enable) {
policy->turn_tls_enabled = enable;
}
bool_t linphone_nat_policy_tls_turn_transport_enabled(LinphoneNatPolicy *policy) {
return linphone_nat_policy_is_tls_turn_transport_enabled(policy);
}
bool_t linphone_nat_policy_is_tls_turn_transport_enabled(LinphoneNatPolicy *policy) {
return policy->turn_tls_enabled;
}
......
......@@ -5993,13 +5993,13 @@ LINPHONE_PUBLIC void linphone_core_set_default_conference_layout(LinphoneCore *l
LINPHONE_PUBLIC LinphoneConferenceLayout linphone_core_get_default_conference_layout(const LinphoneCore *lc);
/**
* Retrieve the conference information linked to the provided URI.
* Retrieve the conference information linked to the provided URI if any.
* @param core #LinphoneCore object. @notnil
* @param uri #LinphoneAddress of the uri. @notnil
* @return The #LinphoneConferenceInfo. @tobefreed @maybenil
* @return The #LinphoneConferenceInfo found if any, NULL otherwise. @tobefreed @maybenil
* @ingroup conference
*/
LINPHONE_PUBLIC LinphoneConferenceInfo *linphone_core_get_conference_information_from_uri(LinphoneCore *core, LinphoneAddress *uri);
LINPHONE_PUBLIC LinphoneConferenceInfo *linphone_core_find_conference_information_from_uri(LinphoneCore *core, LinphoneAddress *uri);
/**
* Retrieve the list of conference information on DB.
......
......@@ -79,62 +79,132 @@ LINPHONE_PUBLIC void linphone_nat_policy_clear(LinphoneNatPolicy *policy);
* Tell whether STUN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether STUN is enabled.
* @deprecated 15/12/2021 Use linphone_nat_policy_is_stun_enabled() instead.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_stun_enabled(const LinphoneNatPolicy *policy);
/**
* Tell whether STUN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether STUN is enabled.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_is_stun_enabled(const LinphoneNatPolicy *policy);
/**
* Enable STUN.
* If TURN is also enabled, TURN will be used instead of STUN.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable STUN.
* @deprecated 15/12/2021 Use linphone_nat_policy_set_stun_enabled() instead.
*/
LINPHONE_PUBLIC void linphone_nat_policy_enable_stun(LinphoneNatPolicy *policy, bool_t enable);
/**
* Enable STUN.
* If TURN is also enabled, TURN will be used instead of STUN.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable STUN.
*/
LINPHONE_PUBLIC void linphone_nat_policy_set_stun_enabled(LinphoneNatPolicy *policy, bool_t enable);
/**
* Tell whether TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether TURN is enabled.
* @deprecated 15/12/2021 Use linphone_nat_policy_is_turn_enabled() instead.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_turn_enabled(const LinphoneNatPolicy *policy);
/**
* Tell whether TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether TURN is enabled.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_is_turn_enabled(const LinphoneNatPolicy *policy);
/**
* Enable TURN.
* If STUN is also enabled, it is ignored and TURN is used.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable TURN.
* @deprecated 15/12/2021 Use linphone_nat_policy_set_turn_enabled() instead.
*/
LINPHONE_PUBLIC void linphone_nat_policy_enable_turn(LinphoneNatPolicy *policy, bool_t enable);
/**
* Enable TURN.
* If STUN is also enabled, it is ignored and TURN is used.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable TURN.
*/
LINPHONE_PUBLIC void linphone_nat_policy_set_turn_enabled(LinphoneNatPolicy *policy, bool_t enable);
/**
* Tell whether ICE is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether ICE is enabled.
* @deprecated 15/12/2021 Use linphone_nat_policy_is_ice_enabled() instead.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_ice_enabled(const LinphoneNatPolicy *policy);
/**
* Tell whether ICE is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether ICE is enabled.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_is_ice_enabled(const LinphoneNatPolicy *policy);
/**
* Enable ICE.
* ICE can be enabled without STUN/TURN, in which case only the local candidates will be used.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable ICE.
* @deprecated 15/12/2021 Use linphone_nat_policy_set_ice_enabled() instead.
*/
LINPHONE_PUBLIC void linphone_nat_policy_enable_ice(LinphoneNatPolicy *policy, bool_t enable);
/**
* Enable ICE.
* ICE can be enabled without STUN/TURN, in which case only the local candidates will be used.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable ICE.
*/
LINPHONE_PUBLIC void linphone_nat_policy_set_ice_enabled(LinphoneNatPolicy *policy, bool_t enable);
/**
* Tell whether uPnP is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether uPnP is enabled.
* @deprecated 15/12/2021 Use linphone_nat_policy_is_upnp_enabled() instead.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_upnp_enabled(const LinphoneNatPolicy *policy);
/**
* Tell whether uPnP is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether uPnP is enabled.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_is_upnp_enabled(const LinphoneNatPolicy *policy);
/**
* Enable uPnP.
* This has the effect to disable every other policies (ICE, STUN and TURN).
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable uPnP.
* @deprecated 15/12/2021 Use linphone_nat_policy_set_upnp_enabled() instead.
*/
LINPHONE_PUBLIC void linphone_nat_policy_enable_upnp(LinphoneNatPolicy *policy, bool_t enable);
/**
* Enable uPnP.
* This has the effect to disable every other policies (ICE, STUN and TURN).
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable uPnP.
*/
LINPHONE_PUBLIC void linphone_nat_policy_set_upnp_enabled(LinphoneNatPolicy *policy, bool_t enable);
/**
* Get the STUN/TURN server to use with this NAT policy.
* Used when STUN or TURN are enabled.
......@@ -189,49 +259,103 @@ LINPHONE_PUBLIC const struct addrinfo * linphone_nat_policy_get_stun_server_addr
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable UDP TURN transport.
* @deprecated 15/12/2021 Use linphone_nat_policy_set_udp_turn_transport_enabled() instead.
*/
LINPHONE_PUBLIC void linphone_nat_policy_enable_udp_turn_transport(LinphoneNatPolicy *policy, bool_t enable);
/**
* Enable UDP TURN transport.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable UDP TURN transport.
*/
LINPHONE_PUBLIC void linphone_nat_policy_set_udp_turn_transport_enabled(LinphoneNatPolicy *policy, bool_t enable);
/**
* Tells whether UDP TURN transport is enabled.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether UDP TURN transport is enabled.
* @deprecated 15/12/2021 Use linphone_nat_policy_is_udp_turn_transport_enabled() instead.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_udp_turn_transport_enabled(LinphoneNatPolicy *policy);
/**
* Tells whether UDP TURN transport is enabled.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether UDP TURN transport is enabled.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_is_udp_turn_transport_enabled(LinphoneNatPolicy *policy);
/**
* Enable TCP TURN transport.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable TCP TURN transport.
* @deprecated 15/12/2021 Use linphone_nat_policy_set_tcp_turn_transport_enabled() instead.
*/
LINPHONE_PUBLIC void linphone_nat_policy_enable_tcp_turn_transport(LinphoneNatPolicy *policy, bool_t enable);
/**
* Enable TCP TURN transport.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable TCP TURN transport.
*/
LINPHONE_PUBLIC void linphone_nat_policy_set_tcp_turn_transport_enabled(LinphoneNatPolicy *policy, bool_t enable);
/**
* Tells whether TCP TURN transport is enabled.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether TCP TURN transport is enabled.
* @deprecated 15/12/2021 Use linphone_nat_policy_is_tcp_turn_transport_enabled() instead.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_tcp_turn_transport_enabled(LinphoneNatPolicy *policy);
/**
* Tells whether TCP TURN transport is enabled.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether TCP TURN transport is enabled.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_is_tcp_turn_transport_enabled(LinphoneNatPolicy *policy);
/**
* Enable TLS TURN transport.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable TLS TURN transport.
* @deprecated 15/12/2021 Use linphone_nat_policy_set_tls_turn_transport_enabled() instead.
*/
LINPHONE_PUBLIC void linphone_nat_policy_enable_tls_turn_transport(LinphoneNatPolicy *policy, bool_t enable);
/**
* Enable TLS TURN transport.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @param enable Boolean value telling whether to enable TLS TURN transport.
*/
LINPHONE_PUBLIC void linphone_nat_policy_set_tls_turn_transport_enabled(LinphoneNatPolicy *policy, bool_t enable);
/**
* Tells whether TLS TURN transport is enabled.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether TLS TURN transport is enabled.
* @deprecated 15/12/2021 Use linphone_nat_policy_is_tls_turn_transport_enabled() instead.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_tls_turn_transport_enabled(LinphoneNatPolicy *policy);
/**
* Tells whether TLS TURN transport is enabled.
* Used when TURN is enabled.
* @param policy #LinphoneNatPolicy object @notnil
* @return Boolean value telling whether TLS TURN transport is enabled.
*/
LINPHONE_PUBLIC bool_t linphone_nat_policy_is_tls_turn_transport_enabled(LinphoneNatPolicy *policy);
/**
* Returns the #LinphoneCore object managing this nat policy, if any.
* @param policy #LinphoneNatPolicy object @notnil
......
......@@ -2412,7 +2412,7 @@ static LinphoneAddress * create_conference_on_server(Focus & focus, ClientConfer
if (!conference_address) {
conference_address = linphone_address_clone(linphone_conference_info_get_uri(conf_info_from_original_content));
}
LinphoneConferenceInfo * conf_info_in_db = linphone_core_get_conference_information_from_uri(mgr->lc, conference_address);
LinphoneConferenceInfo * conf_info_in_db = linphone_core_find_conference_information_from_uri(mgr->lc, conference_address);
if(!BC_ASSERT_PTR_NOT_NULL(conf_info_in_db)) {
return conference_address;
}
......@@ -2460,7 +2460,7 @@ static LinphoneAddress * create_conference_on_server(Focus & focus, ClientConfer
participant_stats.pop_front();
}
LinphoneConferenceInfo * conf_info_in_db = linphone_core_get_conference_information_from_uri(organizer.getLc(), conference_address);
LinphoneConferenceInfo * conf_info_in_db = linphone_core_find_conference_information_from_uri(organizer.getLc(), conference_address);
if(BC_ASSERT_PTR_NOT_NULL(conf_info_in_db)) {
BC_ASSERT_TRUE(linphone_address_weak_equal(organizer.getCMgr()->identity, linphone_conference_info_get_organizer(conf_info_in_db)));
BC_ASSERT_TRUE(linphone_address_weak_equal(conference_address, linphone_conference_info_get_uri(conf_info_in_db)));
......