diff --git a/coreapi/event.c b/coreapi/event.c index f4f69b7a5..3961a0d50 100644 --- a/coreapi/event.c +++ b/coreapi/event.c @@ -133,14 +133,9 @@ void linphone_event_set_publish_state(LinphoneEvent *lev, LinphonePublishState s linphone_core_notify_publish_state_changed(lev->lc,lev,state); switch(state){ case LinphonePublishCleared: - if (lev->expires!=-1){ - linphone_event_release(lev); - } + linphone_event_release(lev); break; case LinphonePublishOk: - if (lev->expires==-1){ - linphone_event_release(lev); - } break; case LinphonePublishError: linphone_event_release(lev); @@ -200,7 +195,7 @@ int linphone_event_send_subscribe(LinphoneEvent *lev, const LinphoneContent *bod switch (lev->subscription_state){ case LinphoneSubscriptionIncomingReceived: case LinphoneSubscriptionTerminated: - case LinphoneSubscriptionOutgoingInit: + case LinphoneSubscriptionOutgoingProgress: ms_error("linphone_event_send_subscribe(): cannot update subscription while in state [%s]", linphone_subscription_state_to_string(lev->subscription_state)); return -1; break; @@ -223,7 +218,7 @@ int linphone_event_send_subscribe(LinphoneEvent *lev, const LinphoneContent *bod err=sal_subscribe(lev->op,NULL,NULL,lev->name,lev->expires,body_handler); if (err==0){ if (lev->subscription_state==LinphoneSubscriptionNone) - linphone_event_set_state(lev,LinphoneSubscriptionOutgoingInit); + linphone_event_set_state(lev,LinphoneSubscriptionOutgoingProgress); } return err; } @@ -372,8 +367,8 @@ void linphone_event_terminate(LinphoneEvent *lev){ if (lev->publish_state!=LinphonePublishNone){ if (lev->publish_state==LinphonePublishOk && lev->expires!=-1){ - sal_publish(lev->op,NULL,NULL,NULL,0,NULL); - }else sal_op_unpublish(lev->op); + sal_op_unpublish(lev->op); + } linphone_event_set_publish_state(lev,LinphonePublishCleared); return; } diff --git a/coreapi/event.h b/coreapi/event.h index 7f281b629..247df2a9d 100644 --- a/coreapi/event.h +++ b/coreapi/event.h @@ -49,6 +49,7 @@ typedef enum _LinphoneSubscriptionDir LinphoneSubscriptionDir; /** * Enum for subscription states. + * LinphoneSubscriptionTerminated and LinphoneSubscriptionError are final states. **/ enum _LinphoneSubscriptionState{ LinphoneSubscriptionNone, /**< Initial state, should not be used.**/ @@ -57,13 +58,10 @@ enum _LinphoneSubscriptionState{ LinphoneSubscriptionPending, /**refresh_generic_subscribe property is set to 0.*/ }; -/*typo compatibility*/ -#define LinphoneSubscriptionOutoingInit LinphoneSubscriptionOutgoingInit -#define LinphoneSubscriptionOutgoingInit LinphoneSubscriptionOutgoingProgress /** * Typedef for subscription state enum. **/ diff --git a/tester/call_video_tester.c b/tester/call_video_tester.c index 2c5e7bc06..1719d6a77 100644 --- a/tester/call_video_tester.c +++ b/tester/call_video_tester.c @@ -954,8 +954,6 @@ static void call_with_ice_video_added_with_video_policies_to_false(void) { _call_with_ice_video(vpol, vpol, FALSE, TRUE, FALSE, FALSE); } -#if ICE_WAS_WORKING_WITH_REAL_TIME_TEXT /*which is not the case at the moment*/ - static void call_with_ice_video_and_rtt(void) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); @@ -980,7 +978,7 @@ static void call_with_ice_video_and_rtt(void) { linphone_core_set_video_port(pauline->lc, -1); linphone_core_set_text_port(pauline->lc, -1); - params = linphone_core_create_default_call_parameters(pauline->lc); + params = linphone_core_create_call_params(pauline->lc, NULL); linphone_call_params_enable_realtime_text(params, TRUE); BC_ASSERT_TRUE(call_ok = call_with_caller_params(pauline, marie, params)); if (!call_ok) goto end; @@ -998,7 +996,6 @@ end: linphone_core_manager_destroy(pauline); } -#endif static void video_call_with_early_media_no_matching_audio_codecs(void) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); @@ -1750,9 +1747,7 @@ test_t call_video_tests[] = { TEST_ONE_TAG("Call with ICE and video added 3", call_with_ice_video_added_3, "ICE"), TEST_ONE_TAG("Call with ICE and video added and refused", call_with_ice_video_added_and_refused, "ICE"), TEST_ONE_TAG("Call with ICE and video added with video policies to false", call_with_ice_video_added_with_video_policies_to_false, "ICE"), -#if ICE_WAS_WORKING_WITH_REAL_TIME_TEXT TEST_ONE_TAG("Call with ICE, video and realtime text", call_with_ice_video_and_rtt, "ICE"), -#endif TEST_ONE_TAG("Video call with ICE accepted using call params", video_call_ice_params, "ICE"), TEST_ONE_TAG("Audio call with ICE paused with caller video policy enabled", audio_call_with_ice_with_video_policy_enabled, "ICE"), TEST_NO_TAG("Video call recording (H264)", video_call_recording_h264_test), diff --git a/tester/eventapi_tester.c b/tester/eventapi_tester.c index e98e40c70..76533857b 100644 --- a/tester/eventapi_tester.c +++ b/tester/eventapi_tester.c @@ -436,8 +436,9 @@ static void publish_test_with_args(bool_t refresh, int expires){ lev=linphone_core_create_publish(marie->lc,pauline->identity,"dodo",expires); linphone_event_add_custom_header(lev,"CustomHeader","someValue"); - linphone_event_send_publish(lev,content); linphone_event_ref(lev); + linphone_event_send_publish(lev,content); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphonePublishProgress,1,1000)); BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphonePublishOk,1,3000));