From 504616b3ef6086b47ad7a0bdae66190edae6230d Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 18 Mar 2014 10:56:23 +0100 Subject: [PATCH] add set/get for SDP control --- coreapi/linphonecore.c | 7 +++++ coreapi/linphonecore.h | 15 +++++++++++ coreapi/linphonecore_jni.cc | 15 +++++++++-- tester/call_tester.c | 4 ++- tester/rcfiles/marie_no_sdp_rc | 48 ---------------------------------- 5 files changed, 38 insertions(+), 51 deletions(-) delete mode 100644 tester/rcfiles/marie_no_sdp_rc diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 66f7efa43..124d400dc 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -6502,3 +6502,10 @@ void linphone_core_set_chat_database_path(LinphoneCore *lc, const char *path){ linphone_core_message_storage_init(lc); } } +void linphone_core_enable_sdp_200_ack(LinphoneCore *lc, bool_t enable) { + lp_config_set_int(lc->config,"sip","sdp_200_ack",lc->sip_conf.sdp_200_ack=enable); +} +bool_t linphone_core_sdp_200_ack_enabled(const LinphoneCore *lc) { + return lc->sip_conf.sdp_200_ack!=0; +} + diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 32a092176..c5e5d717f 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -2329,6 +2329,21 @@ LINPHONE_PUBLIC bool_t linphone_core_is_provisioning_transient(LinphoneCore *lc) LINPHONE_PUBLIC int linphone_core_migrate_to_multi_transport(LinphoneCore *lc); LINPHONE_PUBLIC void linphone_core_set_call_error_tone(LinphoneCore *lc, LinphoneReason reason, const char *audiofile); + +/** + * Control when media offer is sent in SIP INVITE. + * @param lc the linphone core + * @param enable true if INVITE has to be sent whitout SDP. + * @ingroup network_parameters +**/ +LINPHONE_PUBLIC void linphone_core_enable_sdp_200_ack(LinphoneCore *lc, bool_t enable); +/** + * Media offer control param for SIP INVITE. + * @return true if INVITE has to be sent whitout SDP. + * @ingroup network_parameters +**/ +LINPHONE_PUBLIC bool_t linphone_core_sdp_200_ack_enabled(const LinphoneCore *lc); + #ifdef __cplusplus } #endif diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 163dbbc4b..1b6746679 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -4593,6 +4593,17 @@ JNIEXPORT jstring JNICALL Java_org_linphone_core_PayloadTypeImpl_getSendFmtp(JNI } - - +JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_enableSdp200Ack(JNIEnv* env + ,jobject thiz + ,jlong lc + ,jboolean enable) { + linphone_core_enable_sdp_200_ack((LinphoneCore*)lc,enable); +} + +JNIEXPORT jbool JNICALL Java_org_linphone_core_LinphoneCoreImpl_isSdp200AckEnabled(JNIEnv* env + ,jobject thiz + ,jlong lc) { + return (jbool)linphone_core_sdp_200_ack_enabled((const LinphoneCore*)lc); +} + diff --git a/tester/call_tester.c b/tester/call_tester.c index 21188b9c1..cfb4a7333 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -478,9 +478,11 @@ static void call_terminated_by_caller(void) { } static void call_with_no_sdp(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_no_sdp_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + linphone_core_enable_sdp_200_ack(marie->lc,TRUE); + CU_ASSERT_TRUE(call(marie,pauline)); /*just to sleep*/ linphone_core_terminate_all_calls(pauline->lc); diff --git a/tester/rcfiles/marie_no_sdp_rc b/tester/rcfiles/marie_no_sdp_rc deleted file mode 100644 index 50a740dca..000000000 --- a/tester/rcfiles/marie_no_sdp_rc +++ /dev/null @@ -1,48 +0,0 @@ -[sip] -sip_port=5082 -sip_tcp_port=5082 -sip_tls_port=5083 -default_proxy=0 -ping_with_options=0 -register_only_when_network_is_up=0 -sdp_200_ack=1 - -[auth_info_0] -username=marie -userid=marie -passwd=secret -realm=sip.example.org - - -[proxy_0] -reg_proxy=sip.example.org;transport=tcp -reg_route=sip.example.org;transport=tcp;lr -reg_identity=sip:marie@sip.example.org -reg_expires=3600 -reg_sendregister=1 -publish=0 -dial_escape_plus=0 - -[friend_0] -url="Paupoche" -pol=accept -subscribe=0 - - -[rtp] -audio_rtp_port=8070 -video_rtp_port=8072 - -[video] -display=0 -capture=0 -show_local=0 -size=vga -enabled=0 -self_view=0 -automatically_initiate=0 -automatically_accept=0 -device=StaticImage: Static picture - -[sound] -echocancellation=0 #to not overload cpu in case of VG