...
 
Commits (6)
...@@ -69,12 +69,10 @@ cmake_dependent_option(ENABLE_ASSISTANT "Turn on assistant compiling." YES "ENAB ...@@ -69,12 +69,10 @@ cmake_dependent_option(ENABLE_ASSISTANT "Turn on assistant compiling." YES "ENAB
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
if(NOT CMAKE_BUILD_TYPE) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DNDEBUG")
endif() set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG")
if(ENABLE_STATIC) if(ENABLE_STATIC)
set(LINPHONE_LIBS_FOR_TOOLS linphone-static) set(LINPHONE_LIBS_FOR_TOOLS linphone-static)
......
...@@ -94,7 +94,7 @@ static void _linphone_factory_destroying_cb(void) { ...@@ -94,7 +94,7 @@ static void _linphone_factory_destroying_cb(void) {
#define ADD_SUPPORTED_VIDEO_DEFINITION(factory, width, height, name) \ #define ADD_SUPPORTED_VIDEO_DEFINITION(factory, width, height, name) \
(factory)->supported_video_definitions = bctbx_list_append((factory)->supported_video_definitions, \ (factory)->supported_video_definitions = bctbx_list_append((factory)->supported_video_definitions, \
linphone_video_definition_ref(linphone_video_definition_new(width, height, name))) linphone_video_definition_new(width, height, name))
static void initialize_supported_video_definitions(LinphoneFactory *factory) { static void initialize_supported_video_definitions(LinphoneFactory *factory) {
#if !defined(__ANDROID__) && !TARGET_OS_IPHONE #if !defined(__ANDROID__) && !TARGET_OS_IPHONE
...@@ -179,7 +179,8 @@ LinphoneVcard *linphone_factory_create_vcard(LinphoneFactory *factory) { ...@@ -179,7 +179,8 @@ LinphoneVcard *linphone_factory_create_vcard(LinphoneFactory *factory) {
} }
LinphoneVideoDefinition * linphone_factory_create_video_definition(const LinphoneFactory *factory, unsigned int width, unsigned int height) { LinphoneVideoDefinition * linphone_factory_create_video_definition(const LinphoneFactory *factory, unsigned int width, unsigned int height) {
return linphone_video_definition_ref(linphone_video_definition_new(width, height, NULL)); LinphoneVideoDefinition *supported = linphone_factory_find_supported_video_definition(factory, width, height);
return supported ? linphone_video_definition_clone(supported) : linphone_video_definition_new(width, height, NULL);
} }
LinphoneVideoDefinition * linphone_factory_create_video_definition_from_name(const LinphoneFactory *factory, const char *name) { LinphoneVideoDefinition * linphone_factory_create_video_definition_from_name(const LinphoneFactory *factory, const char *name) {
...@@ -201,16 +202,17 @@ LinphoneVideoDefinition * linphone_factory_find_supported_video_definition(const ...@@ -201,16 +202,17 @@ LinphoneVideoDefinition * linphone_factory_find_supported_video_definition(const
const bctbx_list_t *item; const bctbx_list_t *item;
const bctbx_list_t *supported = linphone_factory_get_supported_video_definitions(factory); const bctbx_list_t *supported = linphone_factory_get_supported_video_definitions(factory);
LinphoneVideoDefinition *searched_vdef = linphone_video_definition_new(width, height, NULL); LinphoneVideoDefinition *searched_vdef = linphone_video_definition_new(width, height, NULL);
LinphoneVideoDefinition *found = NULL;
for (item = supported; item != NULL; item = bctbx_list_next(item)) { for (item = supported; item != NULL; item = bctbx_list_next(item)) {
LinphoneVideoDefinition *svdef = (LinphoneVideoDefinition *)bctbx_list_get_data(item); LinphoneVideoDefinition *svdef = (LinphoneVideoDefinition *)bctbx_list_get_data(item);
if (linphone_video_definition_equals(svdef, searched_vdef)) { if (linphone_video_definition_equals(svdef, searched_vdef)) {
linphone_video_definition_unref(searched_vdef); found = svdef;
return linphone_video_definition_clone(svdef); break;
} }
} }
linphone_video_definition_unref(searched_vdef);
return searched_vdef; return found;
} }
LinphoneVideoDefinition * linphone_factory_find_supported_video_definition_by_name(const LinphoneFactory *factory, const char *name) { LinphoneVideoDefinition * linphone_factory_find_supported_video_definition_by_name(const LinphoneFactory *factory, const char *name) {
...@@ -220,7 +222,7 @@ LinphoneVideoDefinition * linphone_factory_find_supported_video_definition_by_na ...@@ -220,7 +222,7 @@ LinphoneVideoDefinition * linphone_factory_find_supported_video_definition_by_na
for (item = supported; item != NULL; item = bctbx_list_next(item)) { for (item = supported; item != NULL; item = bctbx_list_next(item)) {
LinphoneVideoDefinition *svdef = (LinphoneVideoDefinition *)bctbx_list_get_data(item); LinphoneVideoDefinition *svdef = (LinphoneVideoDefinition *)bctbx_list_get_data(item);
if (strcmp(linphone_video_definition_get_name(svdef), name) == 0) { if (strcmp(linphone_video_definition_get_name(svdef), name) == 0) {
return linphone_video_definition_clone(svdef); return svdef;
} }
} }
return NULL; return NULL;
......
...@@ -2040,10 +2040,10 @@ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){ ...@@ -2040,10 +2040,10 @@ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){
if (vstream != NULL) { if (vstream != NULL) {
call->current_params->sent_vsize = video_stream_get_sent_video_size(vstream); call->current_params->sent_vsize = video_stream_get_sent_video_size(vstream);
call->current_params->recv_vsize = video_stream_get_received_video_size(vstream); call->current_params->recv_vsize = video_stream_get_received_video_size(vstream);
call->current_params->sent_vdef = linphone_video_definition_ref(linphone_factory_find_supported_video_definition( call->current_params->sent_vdef = linphone_factory_create_video_definition(
linphone_factory_get(), call->current_params->sent_vsize.width, call->current_params->sent_vsize.height)); linphone_factory_get(), call->current_params->sent_vsize.width, call->current_params->sent_vsize.height);
call->current_params->recv_vdef = linphone_video_definition_ref(linphone_factory_find_supported_video_definition( call->current_params->recv_vdef = linphone_factory_create_video_definition(
linphone_factory_get(), call->current_params->recv_vsize.width, call->current_params->recv_vsize.height)); linphone_factory_get(), call->current_params->recv_vsize.width, call->current_params->recv_vsize.height);
call->current_params->sent_fps = video_stream_get_sent_framerate(vstream); call->current_params->sent_fps = video_stream_get_sent_framerate(vstream);
call->current_params->received_fps = video_stream_get_received_framerate(vstream); call->current_params->received_fps = video_stream_get_received_framerate(vstream);
} }
......
...@@ -27,13 +27,23 @@ static void linphone_video_definition_destroy(LinphoneVideoDefinition *vdef) { ...@@ -27,13 +27,23 @@ static void linphone_video_definition_destroy(LinphoneVideoDefinition *vdef) {
if (vdef->name) bctbx_free(vdef->name); if (vdef->name) bctbx_free(vdef->name);
} }
static void _linphone_video_definition_clone(LinphoneVideoDefinition *obj, const LinphoneVideoDefinition *orig){
obj->name = bctbx_strdup(orig->name);
obj->width = orig->width;
obj->height = orig->height;
}
belle_sip_error_code _linphone_video_definition_marshal(const LinphoneVideoDefinition* obj, char* buff, size_t buff_size, size_t *offset){
return belle_sip_snprintf(buff,buff_size,offset,"%s",obj->name);
}
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneVideoDefinition); BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneVideoDefinition);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneVideoDefinition, belle_sip_object_t, BELLE_SIP_INSTANCIATE_VPTR(LinphoneVideoDefinition, belle_sip_object_t,
(belle_sip_object_destroy_t)linphone_video_definition_destroy, (belle_sip_object_destroy_t)linphone_video_definition_destroy,
NULL, // clone (belle_sip_object_clone_t)_linphone_video_definition_clone, // clone
NULL, // marshal (belle_sip_object_marshal_t)_linphone_video_definition_marshal, // marshal
TRUE FALSE
); );
...@@ -67,7 +77,7 @@ void linphone_video_definition_set_user_data(LinphoneVideoDefinition *vdef, void ...@@ -67,7 +77,7 @@ void linphone_video_definition_set_user_data(LinphoneVideoDefinition *vdef, void
} }
LinphoneVideoDefinition * linphone_video_definition_clone(const LinphoneVideoDefinition *vdef) { LinphoneVideoDefinition * linphone_video_definition_clone(const LinphoneVideoDefinition *vdef) {
return linphone_video_definition_new(linphone_video_definition_get_width(vdef), linphone_video_definition_get_height(vdef), linphone_video_definition_get_name(vdef)); return (LinphoneVideoDefinition*)belle_sip_object_clone((belle_sip_object_t*)vdef);
} }
unsigned int linphone_video_definition_get_width(const LinphoneVideoDefinition *vdef) { unsigned int linphone_video_definition_get_width(const LinphoneVideoDefinition *vdef) {
......
...@@ -427,6 +427,9 @@ bool_t call_with_params2(LinphoneCoreManager* caller_mgr ...@@ -427,6 +427,9 @@ bool_t call_with_params2(LinphoneCoreManager* caller_mgr
BC_ASSERT_FALSE(wait_for_until(callee_mgr->lc,caller_mgr->lc,&caller_mgr->stat.number_of_LinphoneCallStreamsRunning,initial_caller.number_of_LinphoneCallStreamsRunning+2,2000)); BC_ASSERT_FALSE(wait_for_until(callee_mgr->lc,caller_mgr->lc,&caller_mgr->stat.number_of_LinphoneCallStreamsRunning,initial_caller.number_of_LinphoneCallStreamsRunning+2,2000));
BC_ASSERT_FALSE(wait_for_until(callee_mgr->lc,caller_mgr->lc,&callee_mgr->stat.number_of_LinphoneCallStreamsRunning,initial_callee.number_of_LinphoneCallStreamsRunning+2,2000)); BC_ASSERT_FALSE(wait_for_until(callee_mgr->lc,caller_mgr->lc,&callee_mgr->stat.number_of_LinphoneCallStreamsRunning,initial_callee.number_of_LinphoneCallStreamsRunning+2,2000));
}else{
/*wait a bit for streams to start flowing*/
wait_for_until(callee_mgr->lc,caller_mgr->lc, NULL, 0, 500);
} }
if (linphone_core_get_media_encryption(caller_mgr->lc) == LinphoneMediaEncryptionDTLS ) { if (linphone_core_get_media_encryption(caller_mgr->lc) == LinphoneMediaEncryptionDTLS ) {
if (linphone_core_get_current_call(caller_mgr->lc)->audiostream) if (linphone_core_get_current_call(caller_mgr->lc)->audiostream)
...@@ -739,6 +742,7 @@ static void call_outbound_with_multiple_proxy(void) { ...@@ -739,6 +742,7 @@ static void call_outbound_with_multiple_proxy(void) {
// calling marie should go through the second proxy config // calling marie should go through the second proxy config
BC_ASSERT_TRUE(call(marie, pauline)); BC_ASSERT_TRUE(call(marie, pauline));
wait_for_until(marie->lc, pauline->lc, NULL, 0, 1000);
end_call(marie, pauline); end_call(marie, pauline);
linphone_core_manager_destroy(marie); linphone_core_manager_destroy(marie);
...@@ -994,6 +998,7 @@ static void simple_call_compatibility_mode(void) { ...@@ -994,6 +998,7 @@ static void simple_call_compatibility_mode(void) {
BC_ASSERT_TRUE(wait_for(lc_pauline,lc_marie,&stat_marie->number_of_LinphoneCallStreamsRunning,1)); BC_ASSERT_TRUE(wait_for(lc_pauline,lc_marie,&stat_marie->number_of_LinphoneCallStreamsRunning,1));
wait_for(lc_pauline,lc_marie,&stat_marie->number_of_LinphoneCallStreamsRunning,3); wait_for(lc_pauline,lc_marie,&stat_marie->number_of_LinphoneCallStreamsRunning,3);
wait_for_until(lc_pauline,lc_marie,NULL,0, 1000);
end_call(pauline, marie); end_call(pauline, marie);
} }
linphone_core_manager_destroy(marie); linphone_core_manager_destroy(marie);
...@@ -1032,6 +1037,7 @@ static void terminate_call_with_error(void) { ...@@ -1032,6 +1037,7 @@ static void terminate_call_with_error(void) {
BC_ASSERT_STRING_EQUAL(linphone_error_info_get_phrase(ei), "Call refused for security reason"); BC_ASSERT_STRING_EQUAL(linphone_error_info_get_phrase(ei), "Call refused for security reason");
BC_ASSERT_STRING_EQUAL(linphone_error_info_get_protocol(ei), "SIP"); BC_ASSERT_STRING_EQUAL(linphone_error_info_get_protocol(ei), "SIP");
} }
wait_for_until(caller_mgr->lc, callee_mgr->lc, NULL, 0, 1000);
linphone_call_terminate_with_error_info(out_call,ei); linphone_call_terminate_with_error_info(out_call,ei);
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&callee_mgr->stat.number_of_LinphoneCallEnd,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&callee_mgr->stat.number_of_LinphoneCallEnd,1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&callee_mgr->stat.number_of_LinphoneCallReleased,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&callee_mgr->stat.number_of_LinphoneCallReleased,1));
...@@ -1120,20 +1126,22 @@ static void cancel_other_device_after_accept(void) { ...@@ -1120,20 +1126,22 @@ static void cancel_other_device_after_accept(void) {
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallOutgoingProgress, 1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallOutgoingProgress, 1));
call_callee = linphone_core_get_current_call(callee_mgr->lc); call_callee = linphone_core_get_current_call(callee_mgr->lc);
if (BC_ASSERT_PTR_NOT_NULL(call_callee)) { if (BC_ASSERT_PTR_NOT_NULL(call_callee)) {
linphone_call_ref(call_callee); linphone_call_ref(call_callee);
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallIncomingReceived, 1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallIncomingReceived, 1));
call_callee_2 = linphone_core_get_current_call(callee_mgr_2->lc); call_callee_2 = linphone_core_get_current_call(callee_mgr_2->lc);
linphone_call_ref(call_callee_2); linphone_call_ref(call_callee_2);
BC_ASSERT_PTR_NOT_NULL(call_callee_2); BC_ASSERT_PTR_NOT_NULL(call_callee_2);
BC_ASSERT_EQUAL( linphone_call_accept(call_callee), 0 , int, "%d"); BC_ASSERT_EQUAL( linphone_call_accept(call_callee), 0 , int, "%d");
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&caller_mgr->stat.number_of_LinphoneCallConnected,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&caller_mgr->stat.number_of_LinphoneCallConnected,1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallStreamsRunning, 1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallEnd,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallEnd,1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallReleased,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallReleased,1));
wait_for_until(caller_mgr->lc,callee_mgr_2->lc,NULL,0,500);
rei = linphone_call_get_error_info(call_callee_2); rei = linphone_call_get_error_info(call_callee_2);
BC_ASSERT_PTR_NOT_NULL(rei); BC_ASSERT_PTR_NOT_NULL(rei);
if (rei){ if (rei){
...@@ -1172,18 +1180,18 @@ static void cancel_other_device_after_decline(void) { ...@@ -1172,18 +1180,18 @@ static void cancel_other_device_after_decline(void) {
call_callee = linphone_core_get_current_call(callee_mgr->lc); call_callee = linphone_core_get_current_call(callee_mgr->lc);
if (BC_ASSERT_PTR_NOT_NULL(call_callee)) { if (BC_ASSERT_PTR_NOT_NULL(call_callee)) {
linphone_call_ref(call_callee); linphone_call_ref(call_callee);
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallIncomingReceived, 1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr_2->lc, &callee_mgr_2->stat.number_of_LinphoneCallIncomingReceived, 1));
call_callee_2 = linphone_core_get_current_call(callee_mgr_2->lc); call_callee_2 = linphone_core_get_current_call(callee_mgr_2->lc);
linphone_call_ref(call_callee_2); linphone_call_ref(call_callee_2);
BC_ASSERT_PTR_NOT_NULL(call_callee_2); BC_ASSERT_PTR_NOT_NULL(call_callee_2);
BC_ASSERT_EQUAL(linphone_call_decline(call_callee, LinphoneReasonDeclined), 0 , int, "%d"); BC_ASSERT_EQUAL(linphone_call_decline(call_callee, LinphoneReasonDeclined), 0 , int, "%d");
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&caller_mgr->stat.number_of_LinphoneCallEnd,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&caller_mgr->stat.number_of_LinphoneCallEnd,1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallReleased, 1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallReleased, 1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallEnd,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallEnd,1));
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallReleased,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallReleased,1));
rei = linphone_call_get_error_info(call_callee_2); rei = linphone_call_get_error_info(call_callee_2);
BC_ASSERT_PTR_NOT_NULL(rei); BC_ASSERT_PTR_NOT_NULL(rei);
if (rei){ if (rei){
...@@ -1304,11 +1312,11 @@ static void cancelled_ringing_call(void) { ...@@ -1304,11 +1312,11 @@ static void cancelled_ringing_call(void) {
LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
const bctbx_list_t * call_history; const bctbx_list_t * call_history;
LinphoneCall* out_call; LinphoneCall* out_call;
char * db_path= bctbx_strdup_printf("%s,%s",bc_tester_get_writable_dir_prefix(),"tmp_call_log.db"); char * db_path= bc_tester_file("tmp_call_log.db");
linphone_core_set_call_logs_database_path(marie->lc,db_path); linphone_core_set_call_logs_database_path(marie->lc,db_path);
out_call = linphone_core_invite_address(pauline->lc,marie->identity); out_call = linphone_core_invite_address(pauline->lc,marie->identity);
linphone_call_ref(out_call); linphone_call_ref(out_call);
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallIncomingReceived,1)); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallIncomingReceived,1));
...@@ -1318,12 +1326,12 @@ static void cancelled_ringing_call(void) { ...@@ -1318,12 +1326,12 @@ static void cancelled_ringing_call(void) {
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallReleased,1)); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallReleased,1));
BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallEnd,1, int, "%d"); BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallEnd,1, int, "%d");
BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCallEnd,1, int, "%d"); BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCallEnd,1, int, "%d");
call_history = linphone_core_get_call_history(marie->lc); call_history = linphone_core_get_call_history(marie->lc);
BC_ASSERT_PTR_NOT_NULL(call_history); BC_ASSERT_PTR_NOT_NULL(call_history);
BC_ASSERT_EQUAL((int)bctbx_list_size(call_history),1, int,"%i"); BC_ASSERT_EQUAL((int)bctbx_list_size(call_history),1, int,"%i");
BC_ASSERT_EQUAL(linphone_call_log_get_status((LinphoneCallLog*)bctbx_list_get_data(call_history)), LinphoneCallMissed, LinphoneCallStatus, "%i"); BC_ASSERT_EQUAL(linphone_call_log_get_status((LinphoneCallLog*)bctbx_list_get_data(call_history)), LinphoneCallMissed, LinphoneCallStatus, "%i");
linphone_call_unref(out_call); linphone_call_unref(out_call);
linphone_core_manager_destroy(marie); linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline); linphone_core_manager_destroy(pauline);
...@@ -1695,7 +1703,7 @@ static void on_ack_processing(LinphoneCall *call, LinphoneHeaders *ack, bool_t i ...@@ -1695,7 +1703,7 @@ static void on_ack_processing(LinphoneCall *call, LinphoneHeaders *ack, bool_t i
static void call_created(LinphoneCore *lc, LinphoneCall *call){ static void call_created(LinphoneCore *lc, LinphoneCall *call){
LinphoneCallCbs *cbs = linphone_factory_create_call_cbs(linphone_factory_get()); LinphoneCallCbs *cbs = linphone_factory_create_call_cbs(linphone_factory_get());
linphone_call_cbs_set_ack_processing(cbs, on_ack_processing); linphone_call_cbs_set_ack_processing(cbs, on_ack_processing);
linphone_call_add_callbacks(call, cbs); linphone_call_add_callbacks(call, cbs);
linphone_call_cbs_unref(cbs); linphone_call_cbs_unref(cbs);
} }
...@@ -1714,7 +1722,7 @@ static void call_with_custom_headers(void) { ...@@ -1714,7 +1722,7 @@ static void call_with_custom_headers(void) {
char* tmp=linphone_address_as_string_uri_only(marie->identity); char* tmp=linphone_address_as_string_uri_only(marie->identity);
char tmp2[256]; char tmp2[256];
LinphoneCoreCbs *core_cbs = linphone_factory_create_core_cbs(linphone_factory_get()); LinphoneCoreCbs *core_cbs = linphone_factory_create_core_cbs(linphone_factory_get());
snprintf(tmp2,sizeof(tmp2),"%s?uriHeader=myUriHeader",tmp); snprintf(tmp2,sizeof(tmp2),"%s?uriHeader=myUriHeader",tmp);
marie_identity=linphone_address_new(tmp2); marie_identity=linphone_address_new(tmp2);
ms_free(tmp); ms_free(tmp);
...@@ -1724,7 +1732,7 @@ static void call_with_custom_headers(void) { ...@@ -1724,7 +1732,7 @@ static void call_with_custom_headers(void) {
params=linphone_core_create_call_params(marie->lc, NULL); params=linphone_core_create_call_params(marie->lc, NULL);
linphone_call_params_add_custom_header(params,"Weather","bad"); linphone_call_params_add_custom_header(params,"Weather","bad");
linphone_call_params_add_custom_header(params,"Working","yes"); linphone_call_params_add_custom_header(params,"Working","yes");
linphone_core_cbs_set_call_created(core_cbs, call_created); linphone_core_cbs_set_call_created(core_cbs, call_created);
linphone_core_add_callbacks(marie->lc, core_cbs); linphone_core_add_callbacks(marie->lc, core_cbs);
linphone_core_add_callbacks(pauline->lc, core_cbs); linphone_core_add_callbacks(pauline->lc, core_cbs);
...@@ -1759,11 +1767,11 @@ static void call_with_custom_headers(void) { ...@@ -1759,11 +1767,11 @@ static void call_with_custom_headers(void) {
BC_ASSERT_PTR_NOT_NULL(marie_remote_contact_header); BC_ASSERT_PTR_NOT_NULL(marie_remote_contact_header);
BC_ASSERT_STRING_EQUAL(pauline_remote_contact,pauline_remote_contact_header); BC_ASSERT_STRING_EQUAL(pauline_remote_contact,pauline_remote_contact_header);
BC_ASSERT_STRING_EQUAL(marie_remote_contact,marie_remote_contact_header); BC_ASSERT_STRING_EQUAL(marie_remote_contact,marie_remote_contact_header);
/*we need to wait for the ack to arrive*/ /*we need to wait for the ack to arrive*/
wait_for_until(marie->lc, pauline->lc, NULL, 0, 3000); wait_for_until(marie->lc, pauline->lc, NULL, 0, 3000);
BC_ASSERT_TRUE(linphone_call_get_user_data(call_marie) == (void*)1); BC_ASSERT_TRUE(linphone_call_get_user_data(call_marie) == (void*)1);
BC_ASSERT_TRUE(linphone_call_get_user_data(call_pauline) == (void*)1); BC_ASSERT_TRUE(linphone_call_get_user_data(call_pauline) == (void*)1);
...@@ -2505,7 +2513,7 @@ static void call_with_privacy(void) { ...@@ -2505,7 +2513,7 @@ static void call_with_privacy(void) {
BC_ASSERT_EQUAL(linphone_call_params_get_privacy(linphone_call_get_current_params(c2)),LinphonePrivacyId, int, "%d"); BC_ASSERT_EQUAL(linphone_call_params_get_privacy(linphone_call_get_current_params(c2)),LinphonePrivacyId, int, "%d");
} }
liblinphone_tester_check_rtcp(pauline, marie);
end_call(pauline, marie); end_call(pauline, marie);
/*test proxy config privacy*/ /*test proxy config privacy*/
...@@ -2565,7 +2573,7 @@ static void call_with_privacy2(void) { ...@@ -2565,7 +2573,7 @@ static void call_with_privacy2(void) {
BC_ASSERT_EQUAL(linphone_call_params_get_privacy(linphone_call_get_current_params(c2)),LinphonePrivacyId, int, "%d"); BC_ASSERT_EQUAL(linphone_call_params_get_privacy(linphone_call_get_current_params(c2)),LinphonePrivacyId, int, "%d");
} }
liblinphone_tester_check_rtcp(pauline,marie);
end_call(pauline, marie); end_call(pauline, marie);
/*test proxy config privacy*/ /*test proxy config privacy*/
...@@ -2583,6 +2591,7 @@ static void call_with_privacy2(void) { ...@@ -2583,6 +2591,7 @@ static void call_with_privacy2(void) {
BC_ASSERT_FALSE(linphone_address_weak_equal(linphone_call_get_remote_address(c2),pauline->identity)); BC_ASSERT_FALSE(linphone_address_weak_equal(linphone_call_get_remote_address(c2),pauline->identity));
BC_ASSERT_EQUAL(linphone_call_params_get_privacy(linphone_call_get_current_params(c2)),LinphonePrivacyId, int, "%d"); BC_ASSERT_EQUAL(linphone_call_params_get_privacy(linphone_call_get_current_params(c2)),LinphonePrivacyId, int, "%d");
} }
liblinphone_tester_check_rtcp(pauline,marie);
end_call(marie, pauline); end_call(marie, pauline);
linphone_core_manager_destroy(marie); linphone_core_manager_destroy(marie);
......
...@@ -180,12 +180,12 @@ static void profile_call_base(bool_t avpf1 ...@@ -180,12 +180,12 @@ static void profile_call_base(bool_t avpf1
}else { }else {
ms_message("Unsupported [%s] encryption type, cannot test",linphone_media_encryption_to_string(srtp2)); ms_message("Unsupported [%s] encryption type, cannot test",linphone_media_encryption_to_string(srtp2));
goto end; goto end;
} }
BC_ASSERT_TRUE(call(marie, pauline)); BC_ASSERT_TRUE(call(marie, pauline));
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 1));
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1));
wait_for_until(marie->lc, pauline->lc, NULL, 0, 1000); /*wait 1 second for streams to start flowing*/
if (linphone_core_get_current_call(marie->lc)) { if (linphone_core_get_current_call(marie->lc)) {
params = linphone_call_get_current_params(linphone_core_get_current_call(marie->lc)); params = linphone_call_get_current_params(linphone_core_get_current_call(marie->lc));
BC_ASSERT_STRING_EQUAL(linphone_call_params_get_rtp_profile(params), expected_profile); BC_ASSERT_STRING_EQUAL(linphone_call_params_get_rtp_profile(params), expected_profile);
...@@ -453,6 +453,7 @@ static void compatible_avpf_features(void) { ...@@ -453,6 +453,7 @@ static void compatible_avpf_features(void) {
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 1));
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1));
wait_for_until(marie->lc, pauline->lc, NULL, 0, 1000); /*wait 1 second for streams to start flowing*/
check_avpf_features(marie->lc, pt->avpf.features); check_avpf_features(marie->lc, pt->avpf.features);
check_avpf_features(pauline->lc, pt->avpf.features); check_avpf_features(pauline->lc, pt->avpf.features);
...@@ -477,6 +478,7 @@ static void incompatible_avpf_features(void) { ...@@ -477,6 +478,7 @@ static void incompatible_avpf_features(void) {
if (!call_ok) goto end; if (!call_ok) goto end;
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 1));
BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 1));
wait_for_until(marie->lc, pauline->lc, NULL, 0, 1000); /*wait 1 second for streams to start flowing*/
check_avpf_features(marie->lc, PAYLOAD_TYPE_AVPF_NONE); check_avpf_features(marie->lc, PAYLOAD_TYPE_AVPF_NONE);
check_avpf_features(pauline->lc, PAYLOAD_TYPE_AVPF_NONE); check_avpf_features(pauline->lc, PAYLOAD_TYPE_AVPF_NONE);
......