Commit 0d5ffa50 authored by jehan's avatar jehan

No longer change remote destination when ice completed because already done in ms2 ice module

parent 7af7898d
......@@ -4226,25 +4226,6 @@ static void linphone_call_lost(LinphoneCall *call, LinphoneReason reason){
ms_free(temp);
}
static void change_ice_media_destinations(LinphoneCall *call) {
const char *rtp_addr;
const char *rtcp_addr;
int rtp_port;
int rtcp_port;
bool_t result;
int i;
IceCheckList *cl;
for (i = 0; i < SAL_MEDIA_DESCRIPTION_MAX_STREAMS; ++i){
if ((cl = ice_session_check_list(call->ice_session, i)) != NULL){
result = ice_check_list_selected_valid_remote_candidate(cl, &rtp_addr, &rtp_port, &rtcp_addr, &rtcp_port);
if (result == TRUE) {
ms_message("Change stream index %i destination: RTP=%s:%d RTCP=%s:%d", i, rtp_addr, rtp_port, rtcp_addr, rtcp_port);
rtp_session_set_remote_addr_full(call->sessions[i].rtp_session, rtp_addr, rtp_port, rtcp_addr, rtcp_port);
}
}
}
}
static void linphone_call_on_ice_gathering_finished(LinphoneCall *call){
int ping_time;
......@@ -4281,28 +4262,20 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){
switch (ice_session_state(call->ice_session)) {
case IS_Completed:
ice_session_select_candidates(call->ice_session);
if (ice_session_role(call->ice_session) == IR_Controlling
&& params->update_call_when_ice_completed) {
params->internal_call_update = TRUE;
linphone_core_update_call(call->core, call, params);
}
change_ice_media_destinations(call);
start_dtls_on_all_streams(call);
break;
case IS_Failed:
/* At least one ICE session has succeeded, so perform a call update. */
if (ice_session_has_completed_check_list(call->ice_session) == TRUE) {
ice_session_select_candidates(call->ice_session);
if (ice_session_role(call->ice_session) == IR_Controlling) {
/* At least one ICE session has succeeded, so perform a call update. */
if (ice_session_role(call->ice_session) == IR_Controlling && params->update_call_when_ice_completed ) {
params->internal_call_update = TRUE;
linphone_core_update_call(call->core, call, params);
}
start_dtls_on_all_streams(call);
}
break;
default:
break;
}
linphone_core_update_ice_state_in_call_stats(call);
linphone_call_params_unref(params);
} else if (evt == ORTP_EVENT_ICE_GATHERING_FINISHED) {
......
mediastreamer2 @ d948afeb
Subproject commit 832cf41745c6d28f8c62f694a792619be7c88783
Subproject commit d948afeba99b3203d5dfeb967a9b7950d3be91f8
......@@ -129,7 +129,7 @@ static void simple_publish_with_expire(int expires) {
LinphoneProxyConfig* proxy;
LinphonePresenceModel* presence;
linphone_core_get_default_proxy(marie->lc,&proxy);
proxy = linphone_core_get_default_proxy_config(marie->lc);
linphone_proxy_config_edit(proxy);
if (expires >0) {
linphone_proxy_config_set_publish_expires(proxy,expires);
......@@ -743,6 +743,36 @@ static void test_presence_list_subscribe_before_publish(void) {
linphone_core_manager_destroy(pauline);
}
static void test_presence_list_subscription_expire(void) {
LinphoneCoreManager *laure = linphone_core_manager_new("laure_tcp_rc");
const char *rls_uri = "sip:rls@sip.example.org";
LinphoneFriendList *lfl;
LinphoneFriend *lf;
lp_config_set_int(laure->lc->config, "sip", "rls_presence_expires", 3);
lfl = linphone_core_create_friend_list(laure->lc);
linphone_friend_list_set_rls_uri(lfl, rls_uri);
lf = linphone_core_create_friend_with_address(laure->lc, "sip:michelle@sip.inexistentdomain.com");
linphone_friend_list_add_friend(lfl, lf);
linphone_core_set_friend_list(laure->lc, lfl);
linphone_friend_list_update_subscriptions(lfl,NULL,FALSE);
linphone_friend_list_unref(lfl);
/* wait for refresh*/
BC_ASSERT_FALSE(wait_for_until(laure->lc, NULL, &laure->stat.number_of_NotifyPresenceReceived, 1, 4000));
/*sal_set_send_error(laure->lc->sal,1500);*/ /*make sure no refresh is sent, trash the message without generating error*/
/*make sure we don't received any notify, even when subscribtion has expired*/
/*BC_ASSERT_FALSE(wait_for_until(laure->lc, NULL, &laure->stat.number_of_NotifyPresenceReceived, 1, 5000));
sal_set_send_error(laure->lc->sal,0);*/
linphone_core_manager_destroy(laure);
}
test_t presence_tests[] = {
{ "Simple Subscribe", simple_subscribe },
{ "Simple Publish", simple_publish },
......@@ -758,7 +788,8 @@ test_t presence_tests[] = {
{ "Forked subscribe with late publish", test_forked_subscribe_notify_publish },
#endif
{ "Presence list", test_presence_list },
{ "Presence list (subscribe before publish)", test_presence_list_subscribe_before_publish }
{ "Presence list (subscribe before publish)", test_presence_list_subscribe_before_publish },
{ "Presence list, subscription expiration",test_presence_list_subscription_expire}
};
test_suite_t presence_test_suite = {"Presence", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,
......
......@@ -79,10 +79,19 @@ static void linphone_interpret_url_test(void)
LinphoneCore* lc;
const char* sips_address = "sips:margaux@sip.linphone.org";
LinphoneAddress* address;
LinphoneProxyConfig *proxy_config;
char *tmp;
memset ( &v_table,0,sizeof ( v_table ) );
lc = linphone_core_new ( &v_table,NULL,NULL,NULL );
BC_ASSERT_PTR_NOT_NULL_FATAL ( lc );
proxy_config =linphone_core_create_proxy_config(lc);
linphone_proxy_config_set_identity(proxy_config, "sip:moi@sip.linphone.org");
linphone_proxy_config_enable_register(proxy_config, FALSE);
linphone_proxy_config_set_server_addr(proxy_config,"sip:sip.linphone.org");
linphone_core_add_proxy_config(lc, proxy_config);
linphone_core_set_default_proxy_config(lc,proxy_config);
address = linphone_core_interpret_url(lc, sips_address);
......@@ -93,6 +102,33 @@ static void linphone_interpret_url_test(void)
linphone_address_destroy(address);
address = linphone_core_interpret_url(lc,"23");
BC_ASSERT_PTR_NOT_NULL(address);
BC_ASSERT_STRING_EQUAL(linphone_address_get_scheme(address), "sip");
BC_ASSERT_STRING_EQUAL(linphone_address_get_username(address), "23");
BC_ASSERT_STRING_EQUAL(linphone_address_get_domain(address), "sip.linphone.org");
linphone_address_destroy(address);
address = linphone_core_interpret_url(lc,"#24");
BC_ASSERT_PTR_NOT_NULL(address);
BC_ASSERT_STRING_EQUAL(linphone_address_get_scheme(address), "sip");
BC_ASSERT_STRING_EQUAL(linphone_address_get_username(address), "#24");
BC_ASSERT_STRING_EQUAL(linphone_address_get_domain(address), "sip.linphone.org");
tmp = linphone_address_as_string(address);
BC_ASSERT_TRUE(strcmp (tmp,"sip:%2324@sip.linphone.org") == 0);
linphone_address_destroy(address);
address = linphone_core_interpret_url(lc,tmp);
BC_ASSERT_STRING_EQUAL(linphone_address_get_scheme(address), "sip");
BC_ASSERT_STRING_EQUAL(linphone_address_get_username(address), "#24");
BC_ASSERT_STRING_EQUAL(linphone_address_get_domain(address), "sip.linphone.org");
linphone_address_destroy(address);
ms_free(tmp);
linphone_core_destroy ( lc );
}
......
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