From 3d7bbb5bd5a8d627f3f826a613dfb06312822796 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sat, 31 Oct 2015 12:00:28 +0100 Subject: [PATCH] remove linphone_core_create_default_call_parameters() because this function is dangerous and error prone. Indeed, it cannot guarantee that the created call params are compatible with the call being accepted or updated. For doing an outgoing call there is no problem in using it but linphone_core_create_call_params() is better and hard to mis-use. --- console/commands.c | 2 +- console/linphonec.c | 2 +- coreapi/callbacks.c | 2 +- coreapi/help/realtimetext_sender.c | 2 +- coreapi/linphonecore.c | 12 +++++---- coreapi/linphonecore.h | 8 ------ gtk/main.c | 2 +- tester/call_tester.c | 40 +++++++++++++++--------------- tester/flexisip_tester.c | 2 +- tester/message_tester.c | 4 +-- tester/multi_call_tester.c | 8 +++--- tester/quality_reporting_tester.c | 10 ++++---- tester/video_tester.c | 8 +++--- tools/auto_answer.c | 12 ++++----- 14 files changed, 54 insertions(+), 60 deletions(-) diff --git a/console/commands.c b/console/commands.c index f50ed4886..f6cb97e56 100644 --- a/console/commands.c +++ b/console/commands.c @@ -564,7 +564,7 @@ lpc_cmd_call(LinphoneCore *lc, char *args) } { LinphoneCall *call; - LinphoneCallParams *cp=linphone_core_create_default_call_parameters (lc); + LinphoneCallParams *cp=linphone_core_create_call_params (lc, NULL); char *opt1,*opt2; if ( linphone_core_in_call(lc) ) { diff --git a/console/linphonec.c b/console/linphonec.c index cdf06f474..ef0f87e2b 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -359,7 +359,7 @@ static void linphonec_call_state_changed(LinphoneCore *lc, LinphoneCall *call, L if ( auto_answer) { answer_call=TRUE; } else if (real_early_media_sending) { - LinphoneCallParams* callparams = linphone_core_create_default_call_parameters(lc); + LinphoneCallParams* callparams = linphone_core_create_call_params(lc, call); linphonec_out("Sending early media using real hardware\n"); linphone_call_params_enable_early_media_sending(callparams, TRUE); if (vcap_enabled) linphone_call_params_enable_video(callparams, TRUE); diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 814452ad0..f68c7de9d 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -709,7 +709,7 @@ static void call_updating(SalOp *op, bool_t is_update){ if (call->state!=LinphoneCallPaused){ /*Refresh the local description, but in paused state, we don't change anything.*/ if (rmd == NULL && lp_config_get_int(call->core->config,"sip","sdp_200_ack_follow_video_policy",0)) { - LinphoneCallParams *p=linphone_core_create_default_call_parameters (lc); + LinphoneCallParams *p=linphone_core_create_call_params(lc, NULL); ms_message("Applying default policy for offering SDP on call [%p]",call); linphone_call_set_new_params(call, p); linphone_call_params_destroy(p); diff --git a/coreapi/help/realtimetext_sender.c b/coreapi/help/realtimetext_sender.c index 8995196f0..29a738fb2 100644 --- a/coreapi/help/realtimetext_sender.c +++ b/coreapi/help/realtimetext_sender.c @@ -77,7 +77,7 @@ int main(int argc, char *argv[]){ /* Place an outgoing call with rtt enabled */ - LinphoneCallParams *cp = linphone_core_create_default_call_parameters(lc); + LinphoneCallParams *cp = linphone_core_create_call_params(lc, NULL); linphone_call_params_enable_realtime_text(cp,TRUE); /*enable real time text*/ call=linphone_core_invite_with_params(lc,dest,cp); linphone_call_params_destroy(cp); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 080feb83d..43b7c1ef9 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2746,7 +2746,7 @@ const char * linphone_core_get_route(LinphoneCore *lc){ * @return a LinphoneCall corresponding to the new call that is attempted to the transfer destination. **/ LinphoneCall * linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){ - LinphoneCallParams *cp=params ? linphone_call_params_copy(params) : linphone_core_create_default_call_parameters(lc); + LinphoneCallParams *cp=params ? linphone_call_params_copy(params) : linphone_core_create_call_params(lc, NULL); LinphoneCall *newcall; if (call->state!=LinphoneCallPaused){ @@ -2978,7 +2978,7 @@ int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, const Linph **/ LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url){ LinphoneCall *call; - LinphoneCallParams *p=linphone_core_create_default_call_parameters (lc); + LinphoneCallParams *p=linphone_core_create_call_params(lc, NULL); p->has_video &= !!lc->video_policy.automatically_initiate; call=linphone_core_invite_with_params(lc,url,p); linphone_call_params_destroy(p); @@ -3026,7 +3026,7 @@ LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const char *ur **/ LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddress *addr){ LinphoneCall *call; - LinphoneCallParams *p=linphone_core_create_default_call_parameters(lc); + LinphoneCallParams *p=linphone_core_create_call_params(lc, NULL); p->has_video &= !!lc->video_policy.automatically_initiate; call=linphone_core_invite_address_with_params (lc,addr,p); linphone_call_params_destroy(p); @@ -6682,12 +6682,14 @@ LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *lc){ return lc->state; } -LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc){ + +static LinphoneCallParams *_create_call_params(LinphoneCore *lc){ LinphoneCallParams *p=linphone_call_params_new(); linphone_core_init_default_params(lc, p); return p; } + /** * Create a LinphoneCallParams suitable for linphone_core_invite_with_params(), linphone_core_accept_call_with_params(), linphone_core_accept_early_media_with_params(), * linphone_core_accept_call_update(). @@ -6698,7 +6700,7 @@ LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *l * @ingroup call_control */ LinphoneCallParams *linphone_core_create_call_params(LinphoneCore *lc, LinphoneCall *call){ - if (!call) return linphone_core_create_default_call_parameters(lc); + if (!call) return _create_call_params(lc); return linphone_call_params_copy(call->params); } diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index ccaa05913..7c6934221 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -2446,14 +2446,6 @@ LINPHONE_PUBLIC int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *ca LINPHONE_PUBLIC int linphone_core_defer_call_update(LinphoneCore *lc, LinphoneCall *call); LINPHONE_PUBLIC int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params); -/** - * @ingroup media_parameters - * Get default call parameters reflecting current linphone core configuration - * @param lc LinphoneCore object - * @return LinphoneCallParams - * @deprecated use linphone_core_create_call_params() - */ -LINPHONE_PUBLIC LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc); LINPHONE_PUBLIC LinphoneCallParams *linphone_core_create_call_params(LinphoneCore *lc, LinphoneCall *call); diff --git a/gtk/main.c b/gtk/main.c index cb808dac0..1030ae046 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -881,7 +881,7 @@ static gboolean linphone_gtk_start_call_do(GtkWidget *uri_bar){ LinphoneAddress *addr=linphone_core_interpret_url(lc,entered); if (addr!=NULL){ - LinphoneCallParams *params=linphone_core_create_default_call_parameters(lc); + LinphoneCallParams *params=linphone_core_create_call_params(lc, NULL); gchar *record_file=linphone_gtk_get_record_path(addr,FALSE); linphone_call_params_set_record_file(params,record_file); linphone_core_invite_address_with_params(lc,addr,params); diff --git a/tester/call_tester.c b/tester/call_tester.c index 43699e42f..8424bdff2 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -1179,7 +1179,7 @@ static void call_with_custom_headers(void) { linphone_address_destroy(marie->identity); marie->identity=marie_identity; - params=linphone_core_create_default_call_parameters(marie->lc); + 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,"Working","yes"); @@ -1252,7 +1252,7 @@ static void call_with_custom_sdp_attributes(void) { const char *value; LinphoneCoreVTable *vtable; - pauline_params = linphone_core_create_default_call_parameters(pauline->lc); + pauline_params = linphone_core_create_call_params(pauline->lc, NULL); linphone_call_params_add_custom_sdp_attribute(pauline_params, "weather", "bad"); linphone_call_params_add_custom_sdp_attribute(pauline_params, "working", "yes"); linphone_call_params_add_custom_sdp_media_attribute(pauline_params, LinphoneStreamTypeAudio, "sleeping", "almost"); @@ -1408,7 +1408,7 @@ end: static void call_paused_resumed_with_video_base_call_cb(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *message) { if (cstate == LinphoneCallUpdatedByRemote) { - LinphoneCallParams *params = linphone_core_create_default_call_parameters(lc); + LinphoneCallParams *params = linphone_core_create_call_params(lc, call); linphone_call_params_enable_video(params, TRUE); ms_message (" New state LinphoneCallUpdatedByRemote on call [%p], accepting with video on",call); BC_ASSERT_NOT_EQUAL(linphone_core_accept_call_update(lc, call, params), 0, int, "%i"); @@ -1475,7 +1475,7 @@ static void call_paused_resumed_with_video_base(bool_t sdp_200_ack } /*now pauline wants to resume*/ if (resume_in_audio_send_only_video_inactive_first) { - LinphoneCallParams *params = linphone_core_create_default_call_parameters(pauline->lc); + LinphoneCallParams *params = linphone_core_create_call_params(pauline->lc, call_pauline); linphone_call_params_set_video_direction(params,LinphoneMediaDirectionInactive); linphone_call_params_set_audio_direction(params,LinphoneMediaDirectionSendOnly); linphone_core_update_call(pauline->lc,call_pauline,params); @@ -1963,12 +1963,12 @@ static void call_with_declined_video_base(bool_t using_policy) { linphone_core_set_video_policy(pauline->lc,&pauline_policy); } - caller_test_params.base=linphone_core_create_default_call_parameters(pauline->lc); + caller_test_params.base=linphone_core_create_call_params(pauline->lc, NULL); if (!using_policy) linphone_call_params_enable_video(caller_test_params.base,TRUE); if (!using_policy){ - callee_test_params.base=linphone_core_create_default_call_parameters(marie->lc); + callee_test_params.base=linphone_core_create_call_params(marie->lc, NULL); linphone_call_params_enable_video(callee_test_params.base,FALSE); } @@ -2015,9 +2015,9 @@ static void call_with_declined_video_despite_policy(void) { linphone_core_set_video_policy(marie->lc,&marie_policy); linphone_core_set_video_policy(pauline->lc,&pauline_policy); - caller_test_params.base=linphone_core_create_default_call_parameters(pauline->lc); + caller_test_params.base=linphone_core_create_call_params(pauline->lc, NULL); - callee_test_params.base=linphone_core_create_default_call_parameters(marie->lc); + callee_test_params.base=linphone_core_create_call_params(marie->lc, NULL); linphone_call_params_enable_video(callee_test_params.base,FALSE); BC_ASSERT_TRUE((call_ok=call_with_params2(pauline,marie,&caller_test_params,&callee_test_params,FALSE))); @@ -2074,12 +2074,12 @@ void video_call_base_2(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, linphone_core_set_media_encryption(marie->lc,mode); linphone_core_set_media_encryption(pauline->lc,mode); - caller_test_params.base=linphone_core_create_default_call_parameters(pauline->lc); + caller_test_params.base=linphone_core_create_call_params(pauline->lc, NULL); if (!using_policy) linphone_call_params_enable_video(caller_test_params.base,TRUE); if (!using_policy){ - callee_test_params.base=linphone_core_create_default_call_parameters(marie->lc); + callee_test_params.base=linphone_core_create_call_params(marie->lc, NULL); linphone_call_params_enable_video(callee_test_params.base,TRUE); } @@ -2428,7 +2428,7 @@ static void call_with_privacy(void) { LinphoneCall *c1,*c2; LinphoneCallParams *params; LinphoneProxyConfig* pauline_proxy; - params=linphone_core_create_default_call_parameters(pauline->lc); + params=linphone_core_create_call_params(pauline->lc, NULL); linphone_call_params_set_privacy(params,LinphonePrivacyId); BC_ASSERT_TRUE(call_with_caller_params(pauline,marie,params)); @@ -2483,7 +2483,7 @@ static void call_with_privacy2(void) { LinphoneCall *c1,*c2; LinphoneCallParams *params; LinphoneProxyConfig* pauline_proxy; - params=linphone_core_create_default_call_parameters(pauline->lc); + params=linphone_core_create_call_params(pauline->lc, NULL); linphone_call_params_set_privacy(params,LinphonePrivacyId); linphone_core_get_default_proxy(pauline->lc,&pauline_proxy); @@ -3446,7 +3446,7 @@ static void multiple_early_media(void) { LinphoneCoreManager* marie1 = linphone_core_manager_new("marie_early_rc"); LinphoneCoreManager* marie2 = linphone_core_manager_new("marie_early_rc"); MSList *lcs=NULL; - LinphoneCallParams *params=linphone_core_create_default_call_parameters(pauline->lc); + LinphoneCallParams *params=linphone_core_create_call_params(pauline->lc, NULL); LinphoneVideoPolicy pol; LinphoneCall *marie1_call; LinphoneCall *marie2_call; @@ -3616,7 +3616,7 @@ static void accept_call_in_send_only_base(LinphoneCoreManager* pauline, Linphone } if (call) { - params=linphone_core_create_default_call_parameters(marie->lc); + params=linphone_core_create_call_params(marie->lc, NULL); linphone_call_params_set_audio_direction(params,LinphoneMediaDirectionSendOnly); linphone_call_params_set_video_direction(params,LinphoneMediaDirectionSendOnly); linphone_core_accept_call_with_params(marie->lc,call,params); @@ -3716,8 +3716,8 @@ static void record_call(const char *filename, bool_t enableVideo, const char *vi marie = linphone_core_manager_new("marie_h264_rc"); pauline = linphone_core_manager_new("pauline_h264_rc"); - marieParams = linphone_core_create_default_call_parameters(marie->lc); - paulineParams = linphone_core_create_default_call_parameters(pauline->lc); + marieParams = linphone_core_create_call_params(marie->lc, NULL); + paulineParams = linphone_core_create_call_params(pauline->lc, NULL); #ifdef VIDEO_ENABLED linphone_core_set_video_device(pauline->lc, liblinphone_tester_mire_id); @@ -3778,8 +3778,8 @@ static void video_call_recording_vp8_test(void) { static void video_call_snapshot(void) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); - LinphoneCallParams *marieParams = linphone_core_create_default_call_parameters(marie->lc); - LinphoneCallParams *paulineParams = linphone_core_create_default_call_parameters(pauline->lc); + LinphoneCallParams *marieParams = linphone_core_create_call_params(marie->lc, NULL); + LinphoneCallParams *paulineParams = linphone_core_create_call_params(pauline->lc, NULL); LinphoneCall *callInst = NULL; char *filename = create_filepath(bc_tester_get_writable_dir_prefix(), "snapshot", "jpeg"); int dummy = 0; @@ -3920,7 +3920,7 @@ static void call_log_from_taken_from_p_asserted_id(void) { LpConfig *marie_lp; bool_t call_ok; - params=linphone_core_create_default_call_parameters(pauline->lc); + params=linphone_core_create_call_params(pauline->lc, NULL); linphone_call_params_add_custom_header(params,"P-Asserted-Identity",pauline_asserted_id); /*fixme, should be able to add several time the same header linphone_call_params_add_custom_header(params,"P-Asserted-Identity","\"Paupauche\" ");*/ @@ -4132,7 +4132,7 @@ static void early_media_without_sdp_in_200_base( bool_t use_video, bool_t use_ic /* Marie calls Pauline, and after the call has rung, transitions to an early_media session */ - params = linphone_core_create_default_call_parameters(marie->lc); + params = linphone_core_create_call_params(marie->lc, NULL); if( use_video){ diff --git a/tester/flexisip_tester.c b/tester/flexisip_tester.c index be4f60b29..2b60a0f80 100644 --- a/tester/flexisip_tester.c +++ b/tester/flexisip_tester.c @@ -509,7 +509,7 @@ static void early_media_call_forking(void) { LinphoneCoreManager* marie2 = linphone_core_manager_new("marie_early_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); MSList *lcs=NULL; - LinphoneCallParams *params=linphone_core_create_default_call_parameters(pauline->lc); + LinphoneCallParams *params=linphone_core_create_call_params(pauline->lc, NULL); LinphoneVideoPolicy pol; int dummy=0; diff --git a/tester/message_tester.c b/tester/message_tester.c index 42a2c65ac..8927455d6 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -1304,7 +1304,7 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled) { linphone_core_set_media_encryption_mandatory(pauline->lc, TRUE); } - marie_params = linphone_core_create_default_call_parameters(marie->lc); + marie_params = linphone_core_create_call_params(marie->lc, NULL); linphone_call_params_enable_realtime_text(marie_params,TRUE); if (!audio_stream_enabled) { linphone_call_params_enable_audio(marie_params,FALSE); @@ -1359,7 +1359,7 @@ static void real_time_text_conversation(void) { LinphoneChatRoom *pauline_chat_room, *marie_chat_room; LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); - LinphoneCallParams *marie_params = linphone_core_create_default_call_parameters(marie->lc); + LinphoneCallParams *marie_params = linphone_core_create_call_params(marie->lc, NULL); LinphoneCall *pauline_call, *marie_call; linphone_call_params_enable_realtime_text(marie_params,TRUE); diff --git a/tester/multi_call_tester.c b/tester/multi_call_tester.c index 42dae520f..c8021afc3 100644 --- a/tester/multi_call_tester.c +++ b/tester/multi_call_tester.c @@ -39,8 +39,8 @@ static void call_waiting_indication_with_param(bool_t enable_caller_privacy) { MSList* lcs; LinphoneCall* pauline_called_by_marie; LinphoneCall* pauline_called_by_laure=NULL; - LinphoneCallParams *laure_params=linphone_core_create_default_call_parameters(laure->lc); - LinphoneCallParams *marie_params=linphone_core_create_default_call_parameters(marie->lc); + LinphoneCallParams *laure_params=linphone_core_create_call_params(laure->lc, NULL); + LinphoneCallParams *marie_params=linphone_core_create_call_params(marie->lc, NULL); if (enable_caller_privacy) linphone_call_params_set_privacy(marie_params,LinphonePrivacyId); @@ -118,8 +118,8 @@ static void incoming_call_accepted_when_outgoing_call_in_state(LinphoneCallState LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc"); MSList* lcs; - LinphoneCallParams *laure_params=linphone_core_create_default_call_parameters(laure->lc); - LinphoneCallParams *marie_params=linphone_core_create_default_call_parameters(marie->lc); + LinphoneCallParams *laure_params=linphone_core_create_call_params(laure->lc, NULL); + LinphoneCallParams *marie_params=linphone_core_create_call_params(marie->lc, NULL); lcs=ms_list_append(NULL,marie->lc); lcs=ms_list_append(lcs,pauline->lc); diff --git a/tester/quality_reporting_tester.c b/tester/quality_reporting_tester.c index 10f38c21e..0fb1b0c7b 100644 --- a/tester/quality_reporting_tester.c +++ b/tester/quality_reporting_tester.c @@ -188,7 +188,7 @@ static void quality_reporting_not_sent_if_low_bandwidth(void) { LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCallParams* marie_params; - marie_params=linphone_core_create_default_call_parameters(marie->lc); + marie_params=linphone_core_create_call_params(marie->lc, NULL); linphone_call_params_enable_low_bandwidth(marie_params,TRUE); if (create_call_for_quality_reporting_tests(marie, pauline, NULL, NULL, marie_params, NULL)) { @@ -291,9 +291,9 @@ static void quality_reporting_session_report_if_video_stopped(void) { linphone_core_enable_video_display(marie->lc, FALSE); linphone_core_enable_video_capture(pauline->lc, TRUE); linphone_core_enable_video_display(pauline->lc, FALSE); - marie_params=linphone_core_create_default_call_parameters(marie->lc); + marie_params=linphone_core_create_call_params(marie->lc, NULL); linphone_call_params_enable_video(marie_params,TRUE); - pauline_params=linphone_core_create_default_call_parameters(pauline->lc); + pauline_params=linphone_core_create_call_params(pauline->lc, NULL); linphone_call_params_enable_video(pauline_params,TRUE); if (create_call_for_quality_reporting_tests(marie, pauline, &call_marie, &call_pauline, marie_params, pauline_params)) { @@ -371,10 +371,10 @@ static void quality_reporting_interval_report_video_and_rtt(void) { linphone_core_enable_video_display(marie->lc, FALSE); linphone_core_enable_video_capture(pauline->lc, TRUE); linphone_core_enable_video_display(pauline->lc, FALSE); - marie_params=linphone_core_create_default_call_parameters(marie->lc); + marie_params=linphone_core_create_call_params(marie->lc, NULL); linphone_call_params_enable_video(marie_params,TRUE); linphone_call_params_enable_realtime_text(marie_params,TRUE); - pauline_params=linphone_core_create_default_call_parameters(pauline->lc); + pauline_params=linphone_core_create_call_params(pauline->lc, NULL); linphone_call_params_enable_video(pauline_params,TRUE); linphone_call_params_enable_realtime_text(pauline_params,TRUE); diff --git a/tester/video_tester.c b/tester/video_tester.c index 65bd7f97d..1658f765f 100644 --- a/tester/video_tester.c +++ b/tester/video_tester.c @@ -118,7 +118,7 @@ static void early_media_video_call_state_changed(LinphoneCore *lc, LinphoneCall video_call_state_changed(lc, call, cstate, msg); switch (cstate) { case LinphoneCallIncomingReceived: - params = linphone_core_create_default_call_parameters(lc); + params = linphone_core_create_call_params(lc, call); linphone_call_params_enable_video(params, TRUE); linphone_call_params_set_audio_direction(params, LinphoneMediaDirectionSendOnly); linphone_call_params_set_video_direction(params, LinphoneMediaDirectionRecvOnly); @@ -136,7 +136,7 @@ static void early_media_video_call_state_changed_with_inactive_audio(LinphoneCor video_call_state_changed(lc, call, cstate, msg); switch (cstate) { case LinphoneCallIncomingReceived: - params = linphone_core_create_default_call_parameters(lc); + params = linphone_core_create_call_params(lc, call); linphone_call_params_enable_video(params, TRUE); linphone_call_params_set_audio_direction(params, LinphoneMediaDirectionInactive); linphone_call_params_set_video_direction(params, LinphoneMediaDirectionRecvOnly); @@ -208,7 +208,7 @@ static LinphoneCallParams * _configure_for_video(LinphoneCoreManager *manager, L linphone_core_set_video_device(manager->lc, "StaticImage: Static picture"); linphone_core_enable_video_capture(manager->lc, TRUE); linphone_core_enable_video_display(manager->lc, TRUE); - params = linphone_core_create_default_call_parameters(manager->lc); + params = linphone_core_create_call_params(manager->lc, NULL); linphone_call_params_enable_video(params, TRUE); if (linphone_core_find_payload_type(manager->lc,"VP8", 90000, -1)!=NULL){ disable_all_video_codecs_except_one(manager->lc, "VP8"); @@ -422,7 +422,7 @@ static void forked_outgoing_early_media_video_call_with_inactive_audio_test(void lcs = ms_list_append(lcs,marie2->lc); lcs = ms_list_append(lcs,pauline->lc); - pauline_params = linphone_core_create_default_call_parameters(pauline->lc); + pauline_params = linphone_core_create_call_params(pauline->lc, NULL); linphone_call_params_enable_early_media_sending(pauline_params, TRUE); linphone_call_params_enable_video(pauline_params, TRUE); marie1_params = configure_for_early_media_video_receiving_with_inactive_audio(marie1); diff --git a/tools/auto_answer.c b/tools/auto_answer.c index b76968ec4..174d9e235 100644 --- a/tools/auto_answer.c +++ b/tools/auto_answer.c @@ -57,7 +57,7 @@ static void call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCal case LinphoneCallIncomingReceived: ms_message("Incoming call arrive !\n"); /* accept the incoming call*/ - call_params = linphone_core_create_default_call_parameters(lc); + call_params = linphone_core_create_call_params(lc, call); linphone_call_params_enable_video(call_params,TRUE); linphone_call_params_set_audio_direction(call_params,LinphoneMediaDirectionSendOnly); linphone_call_params_set_video_direction(call_params,LinphoneMediaDirectionSendOnly); @@ -70,11 +70,11 @@ static void call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCal } } extern MSWebCamDesc mire_desc; -static void helper() { - printf("auto_answer --help\n" +static void helper(const char *progname) { + printf("%s --help\n" "\t\t\t--listening-uri uri to listen on, default [sip:localhost:5060]\n" "\t\t\t--max-call-duration max duration of a call in seconds, default [3600]\n" - "\t\t\t--verbose\n"); + "\t\t\t--verbose\n", progname); exit(0); } @@ -104,7 +104,7 @@ int main(int argc, char *argv[]){ addr = linphone_address_new(argv[++i]); if (!addr) { printf("Error, bad sip uri"); - helper(); + helper(argv[0]); } /* switch(linphone_address_get_transport(addr)) { case LinphoneTransportUdp: @@ -116,7 +116,7 @@ int main(int argc, char *argv[]){ break; }*/ } else { - helper(); + helper(argv[0]); } }