From 1ece26b89486bac0bd2c1dd4b6f0a14059ef0901 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 10 Oct 2014 13:54:21 +0200 Subject: [PATCH 01/18] repair audio only build --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 8a357b569..2ce9d1844 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 8a357b56945bc1f3675d748ee237c451d3cf470e +Subproject commit 2ce9d184418ae68b36b3ee470df01343abcb407f From 6cccf2da3d76aadb96d887aa308aa7383f456341 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 10 Oct 2014 14:18:06 +0200 Subject: [PATCH 02/18] robustize linphone_core_accept_call_with_params() --- coreapi/linphonecore.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 5a88545bf..427b61577 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3487,8 +3487,7 @@ int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call){ * @param params the specific parameters for this call, for example whether video is accepted or not. Use NULL to use default parameters. * **/ -int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params) -{ +int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){ SalOp *replaced; SalMediaDescription *new_md; bool_t was_ringing=FALSE; @@ -3501,11 +3500,17 @@ int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, call = (LinphoneCall*)linphone_core_get_calls(lc)->data; } - if (call->state==LinphoneCallConnected){ - /*call already accepted*/ - return -1; + switch(call->state){ + case LinphoneCallIncomingReceived: + case LinphoneCallIncomingEarlyMedia: + break; + default: + ms_error("linphone_core_accept_call_with_params() call [%p] is in state [%s], operation not permitted.", + call, linphone_call_state_to_string(call->state)); + return -1; + break; } - + /* check if this call is supposed to replace an already running one*/ replaced=sal_call_get_replaces(call->op); if (replaced){ From a24f4575cb3b59098bc2eeb7a276c1248a848eb1 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 10 Oct 2014 14:30:24 +0200 Subject: [PATCH 03/18] Update oRTP submodule. --- oRTP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oRTP b/oRTP index f4ecaee95..05e0242a9 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit f4ecaee9570f411ff2689e2cb348505833320616 +Subproject commit 05e0242a91391747408340dffa34f9b4e1335be4 From d55e807b1b3f1449bbab754b8d99439cc7afbd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Fri, 10 Oct 2014 14:56:21 +0200 Subject: [PATCH 04/18] Update mediastreamer2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 2ce9d1844..b75ce4033 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 2ce9d184418ae68b36b3ee470df01343abcb407f +Subproject commit b75ce4033f2782ead74d346547e53424aff13664 From 56f0b091f5d660f509a5dd43051c2f33adab7b2c Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 10 Oct 2014 18:06:54 +0200 Subject: [PATCH 05/18] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index b75ce4033..0f0183231 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit b75ce4033f2782ead74d346547e53424aff13664 +Subproject commit 0f0183231426d5f373368a0820ba6aa8a1ad00e2 From fda6945d0dcaa35b17ef142b1861358e243cddf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Fri, 10 Oct 2014 19:05:16 +0200 Subject: [PATCH 06/18] Add licence text in fileplayer.c and player_tester.c --- coreapi/fileplayer.c | 19 +++++++++++++++++++ tester/player_tester.c | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/coreapi/fileplayer.c b/coreapi/fileplayer.c index 505ce2297..fc38f93a8 100644 --- a/coreapi/fileplayer.c +++ b/coreapi/fileplayer.c @@ -1,3 +1,22 @@ +/* +linphone +Copyright (C) 2000 - 2010 Simon MORLAT (simon.morlat@linphone.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + #include "private.h" #include #include diff --git a/tester/player_tester.c b/tester/player_tester.c index a9b82b07a..8eae21dcd 100644 --- a/tester/player_tester.c +++ b/tester/player_tester.c @@ -1,3 +1,21 @@ +/* + liblinphone_tester - liblinphone test suite + Copyright (C) 2013 Belledonne Communications SARL + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "liblinphone_tester.h" static const char *_get_default_video_renderer(void){ From 01b9a97323d8d9111d435d897ec8d5959ba5b573 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 13 Oct 2014 12:07:28 +0200 Subject: [PATCH 07/18] Fix linphone_core_set_log_handler(). --- coreapi/linphonecore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 427b61577..4bfafcd0d 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -144,7 +144,7 @@ const LinphoneAddress *linphone_core_get_current_call_remote_address(struct _Lin } void linphone_core_set_log_handler(OrtpLogFunc logfunc) { - ortp_set_log_handler(liblinphone_log_func); + ortp_set_log_handler(logfunc); } void linphone_core_set_log_file(FILE *file) { From 94313a9535481d72cc3cdb4ddd1771e08d9bb1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 13 Oct 2014 13:38:46 +0200 Subject: [PATCH 08/18] Update mediastreamer2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 0f0183231..f4c48ff76 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 0f0183231426d5f373368a0820ba6aa8a1ad00e2 +Subproject commit f4c48ff7699428655446ee41acb92c7a7f300fbb From 1b40d1a497d7ed5ddc58f2f1a569bcca1f6e0e51 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 13 Oct 2014 15:51:47 +0200 Subject: [PATCH 09/18] Fix automatic wrapping of linphone_core_set_avpf_mode() and linphone_core_set_avpf_rr_interval(). --- coreapi/linphonecore.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 4bfafcd0d..801eb7a43 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -6841,6 +6841,7 @@ void linphone_core_remove_supported_tag(LinphoneCore *lc, const char *tag){ * The value set here is used for calls placed or received out of any proxy configured, or if the proxy config is configured with LinphoneAVPFDefault. * @param lc the LinphoneCore * @param mode the mode. + * @ingroup media_parameters **/ void linphone_core_set_avpf_mode(LinphoneCore *lc, LinphoneAVPFMode mode){ if (mode==LinphoneAVPFDefault) mode=LinphoneAVPFDisabled; @@ -6852,6 +6853,7 @@ void linphone_core_set_avpf_mode(LinphoneCore *lc, LinphoneAVPFMode mode){ * Return AVPF enablement. See linphone_core_set_avpf_mode() . * @param lc the core * @return the avpf enablement mode. + * @ingroup media_parameters **/ LinphoneAVPFMode linphone_core_get_avpf_mode(const LinphoneCore *lc){ return lc->rtp_conf.avpf_mode; @@ -6861,6 +6863,7 @@ LinphoneAVPFMode linphone_core_get_avpf_mode(const LinphoneCore *lc){ * Return the avpf report interval in seconds. * @param lc the LinphoneCore * @return the avpf report interval in seconds. + * @ingroup media_parameters **/ int linphone_core_get_avpf_rr_interval(const LinphoneCore *lc){ return lp_config_get_int(lc->config,"rtp","avpf_rr_interval",5); @@ -6870,7 +6873,8 @@ int linphone_core_get_avpf_rr_interval(const LinphoneCore *lc){ * Set the avpf report interval in seconds. * This value can be overriden by the proxy config using linphone_proxy_config_set_avpf_rr_interval(). * @param lc the core - * @param interval interval in seconds. + * @param interval interval in seconds. + * @ingroup media_parameters **/ void linphone_core_set_avpf_rr_interval(LinphoneCore *lc, int interval){ lp_config_set_int(lc->config,"rtp","avpf_rr_interval",interval); From 5d9bbeeffb1cdacfc0d42e40b3c760ceed17e209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 13 Oct 2014 17:16:40 +0200 Subject: [PATCH 10/18] Add a parameter to linphone_core_create_file_player() to specify the id of the drawing window --- coreapi/fileplayer.c | 4 ++-- coreapi/linphonecore.h | 3 ++- mediastreamer2 | 2 +- tester/player_tester.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/coreapi/fileplayer.c b/coreapi/fileplayer.c index fc38f93a8..103dd205e 100644 --- a/coreapi/fileplayer.c +++ b/coreapi/fileplayer.c @@ -31,11 +31,11 @@ static int file_player_get_current_position(LinphonePlayer *obj); static void file_player_close(LinphonePlayer *obj); static void file_player_eof_callback(void *user_data); -LinphonePlayer *linphone_core_create_file_player(LinphoneCore *lc, MSSndCard *snd_card, const char *video_out) { +LinphonePlayer *linphone_core_create_file_player(LinphoneCore *lc, MSSndCard *snd_card, const char *video_out, void *window_id) { LinphonePlayer *obj = ms_new0(LinphonePlayer, 1); if(snd_card == NULL) snd_card = lc->sound_conf.play_sndcard; if(video_out == NULL) video_out = linphone_core_get_video_display_filter(lc); - obj->impl = ms_file_player_new(snd_card, video_out); + obj->impl = ms_file_player_new(snd_card, video_out, window_id); obj->open = file_player_open; obj->start = file_player_start; obj->pause = file_player_pause; diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 753030612..7dd4d8f55 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -602,9 +602,10 @@ void linphone_player_close(LinphonePlayer *obj); * @param lc A LinphoneCore * @param snd_card Playback sound card. If NULL, the sound card set in LinphoneCore will be used * @param video_out Video display. If NULL, the video display set in LinphoneCore will be used + * @param window_id Pointer on the drawing window * @return A pointer on the new instance. NULL if faild. */ -LINPHONE_PUBLIC LinphonePlayer *linphone_core_create_file_player(LinphoneCore *lc, MSSndCard *snd_card, const char *video_out); +LINPHONE_PUBLIC LinphonePlayer *linphone_core_create_file_player(LinphoneCore *lc, MSSndCard *snd_card, const char *video_out, void *window_id); /** * @brief Destroy a file player diff --git a/mediastreamer2 b/mediastreamer2 index f4c48ff76..9de5799b6 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit f4c48ff7699428655446ee41acb92c7a7f300fbb +Subproject commit 9de5799b612449269531ad196012bbd7d480e1c7 diff --git a/tester/player_tester.c b/tester/player_tester.c index 8eae21dcd..7c37a95de 100644 --- a/tester/player_tester.c +++ b/tester/player_tester.c @@ -59,7 +59,7 @@ static void play_file(const char *filename, bool_t unsupported_format) { CU_ASSERT_PTR_NOT_NULL(lc_manager); if(lc_manager == NULL) return; - player = linphone_core_create_file_player(lc_manager->lc, ms_snd_card_manager_get_default_card(ms_snd_card_manager_get()), _get_default_video_renderer()); + player = linphone_core_create_file_player(lc_manager->lc, ms_snd_card_manager_get_default_card(ms_snd_card_manager_get()), _get_default_video_renderer(), NULL); CU_ASSERT_PTR_NOT_NULL(player); if(player == NULL) goto fail; From 3ae7d1098a0118266c07fce1b21e6acd72e7d86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 14 Oct 2014 10:26:44 +0200 Subject: [PATCH 11/18] Modify JNI glue to pass the window ID while creating a player --- coreapi/linphonecore_jni.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index a676249ee..92b92daf3 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -28,6 +28,7 @@ extern "C" { #include "mediastreamer2/mediastream.h" #include "mediastreamer2/mscommon.h" #include "mediastreamer2/dsptools.h" +#include "mediastreamer2/fileplayer.h" } #include "mediastreamer2/msjava.h" #include "private.h" @@ -5294,15 +5295,18 @@ extern "C" void Java_org_linphone_core_LinphonePlayerImpl_close(JNIEnv *env, job linphone_player_close(player); } -extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_createPlayer(JNIEnv *env, jobject jobj, jlong ptr) { +extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_createPlayer(JNIEnv *env, jobject jobj, jlong ptr, jobject window) { + jobject window_ref = NULL; MSSndCard *snd_card = ms_snd_card_manager_get_default_playback_card(ms_snd_card_manager_get()); if(snd_card == NULL) { ms_error("No default playback sound card found"); return 0; } - LinphonePlayer *player = linphone_core_create_file_player((LinphoneCore *)ptr, snd_card, "MSAndroidDisplay"); + window_ref = env->NewGlobalRef(window); + LinphonePlayer *player = linphone_core_create_file_player((LinphoneCore *)ptr, snd_card, "MSAndroidDisplay", window_ref); if(player == NULL) { ms_error("Fails to create a player"); + if(window_ref) env->DeleteGlobalRef(window_ref); return 0; } else { return (jlong)player; @@ -5312,7 +5316,11 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_createPlayer(JNIEnv *en extern "C" void Java_org_linphone_core_LinphoneCoreImpl_destroyPlayer(JNIEnv *env, jobject jobj, jlong playerPtr) { LinphonePlayer *player = (LinphonePlayer *)playerPtr; if(player->user_data) { - delete (LinphonePlayerData *)player->user_data;; + delete (LinphonePlayerData *)player->user_data; + } + MSFilePlayer *ms_player = (MSFilePlayer *)player->impl; + if(ms_player->window_id) { + env->DeleteGlobalRef((jobject)ms_player->window_id); } linphone_file_player_destroy(player); } From 99d7abfd1e67367ac285c0343da7ded235e1177d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 14 Oct 2014 10:42:19 +0200 Subject: [PATCH 12/18] Update mediastreamer2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 9de5799b6..2fa9c8e25 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 9de5799b612449269531ad196012bbd7d480e1c7 +Subproject commit 2fa9c8e258eacadc789f87d3ea3a152faea291ea From 0f6ce268ae0653553ba68e93e3d015ce59530d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 14 Oct 2014 10:49:08 +0200 Subject: [PATCH 13/18] Fix compilation error for Android --- coreapi/linphonecore_jni.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 92b92daf3..dbcc128c7 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -5318,9 +5318,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_destroyPlayer(JNIEnv *en if(player->user_data) { delete (LinphonePlayerData *)player->user_data; } - MSFilePlayer *ms_player = (MSFilePlayer *)player->impl; - if(ms_player->window_id) { - env->DeleteGlobalRef((jobject)ms_player->window_id); - } + jobject window_id = (jobject)ms_file_player_get_window_id((MSFilePlayer *)player->impl); + if(window_id) env->DeleteGlobalRef(window_id); linphone_file_player_destroy(player); } From b23d6a1d6d4cabeb9f3ea822d91f659357a61165 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 14 Oct 2014 15:21:00 +0200 Subject: [PATCH 14/18] Do not accept video call when video is disabled but video policy is set to automatically accept. --- coreapi/linphonecall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 94d2e20f4..a838fabdc 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -793,7 +793,7 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro call->current_params->privacy=(LinphonePrivacyMask)sal_op_get_privacy(call->op); /*set video support */ md=sal_call_get_remote_media_description(op); - call->params->has_video = lc->video_policy.automatically_accept; + call->params->has_video = linphone_core_video_enabled(lc) && lc->video_policy.automatically_accept; if (md) { // It is licit to receive an INVITE without SDP // In this case WE chose the media parameters according to policy. From 7bc0486b57d646ecce175280bf4f098a376eaf00 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 14 Oct 2014 15:21:43 +0200 Subject: [PATCH 15/18] Apply microphone mute to all calls. --- coreapi/linphonecall.c | 2 +- coreapi/linphonecore.c | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index a838fabdc..5e7f9e5af 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -2176,7 +2176,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut call, linphone_core_get_upload_bandwidth(lc),linphone_core_get_download_bandwidth(lc)); if (call->audiostream!=NULL) { - linphone_call_start_audio_stream(call,cname,all_inputs_muted,send_ringbacktone,use_arc); + linphone_call_start_audio_stream(call,cname,all_inputs_muted||call->audio_muted,send_ringbacktone,use_arc); } call->current_params->has_video=FALSE; if (call->videostream!=NULL) { diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 801eb7a43..fa1adf331 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -4584,26 +4584,28 @@ bool_t linphone_core_echo_limiter_enabled(const LinphoneCore *lc){ return lc->sound_conf.ea; } +static void linphone_core_mute_audio_stream(LinphoneCore *lc, AudioStream *st, bool_t val) { + audio_stream_set_mic_gain(st, + (val==TRUE) ? 0 : pow(10,lc->sound_conf.soft_mic_lev/10)); + if ( linphone_core_get_rtp_no_xmit_on_audio_mute(lc) ){ + audio_stream_mute_rtp(st,val); + } +} + void linphone_core_mute_mic(LinphoneCore *lc, bool_t val){ - LinphoneCall *call=linphone_core_get_current_call(lc); - AudioStream *st=NULL; + LinphoneCall *call; + const MSList *list; + const MSList *elem; + if (linphone_core_is_in_conference(lc)){ lc->conf_ctx.local_muted=val; - st=lc->conf_ctx.local_participant; - }else if (call==NULL){ - ms_warning("linphone_core_mute_mic(): No current call !"); - return; - }else{ - st=call->audiostream; - call->audio_muted=val; + linphone_core_mute_audio_stream(lc, lc->conf_ctx.local_participant, val); } - if (st!=NULL){ - audio_stream_set_mic_gain(st, - (val==TRUE) ? 0 : pow(10,lc->sound_conf.soft_mic_lev/10)); - if ( linphone_core_get_rtp_no_xmit_on_audio_mute(lc) ){ - audio_stream_mute_rtp(st,val); - } - + list = linphone_core_get_calls(lc); + for (elem = list; elem != NULL; elem = elem->next) { + call = (LinphoneCall *)elem->data; + call->audio_muted = val; + linphone_core_mute_audio_stream(lc, call->audiostream, val); } } From 4e1e0df40527b8e8cba741045b90e996293850ed Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 14 Oct 2014 13:59:08 +0200 Subject: [PATCH 16/18] make sure session timer requires refresher to not be linphone --- coreapi/bellesip_sal/sal_op_call.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/coreapi/bellesip_sal/sal_op_call.c b/coreapi/bellesip_sal/sal_op_call.c index 9efbbb7ee..bf352d1b4 100644 --- a/coreapi/bellesip_sal/sal_op_call.c +++ b/coreapi/bellesip_sal/sal_op_call.c @@ -639,7 +639,7 @@ static void sal_op_fill_invite(SalOp *op, belle_sip_request_t* invite) { belle_sip_message_add_header(BELLE_SIP_MESSAGE(invite),BELLE_SIP_HEADER(create_allow(op->base.root->enable_sip_update))); if (op->base.root->session_expires!=0){ - belle_sip_message_add_header(BELLE_SIP_MESSAGE(invite),belle_sip_header_create( "Session-expires", "200")); + belle_sip_message_add_header(BELLE_SIP_MESSAGE(invite),belle_sip_header_create( "Session-expires", "600;refresher=uas")); belle_sip_message_add_header(BELLE_SIP_MESSAGE(invite),belle_sip_header_create( "Supported", "timer")); } if (op->base.local_media){ @@ -766,9 +766,10 @@ int sal_call_accept(SalOp*h){ } belle_sip_message_add_header(BELLE_SIP_MESSAGE(response),BELLE_SIP_HEADER(create_allow(h->base.root->enable_sip_update))); if (h->base.root->session_expires!=0){ - if (h->supports_session_timers) { +/* if (h->supports_session_timers) {*/ belle_sip_message_add_header(BELLE_SIP_MESSAGE(response),belle_sip_header_create("Supported", "timer")); - } + belle_sip_message_add_header(BELLE_SIP_MESSAGE(response),belle_sip_header_create( "Session-expires", "600;refresher=uac")); + /*}*/ } if ((contact_header=sal_op_create_contact(h))) { From 6e9bfc276bf60f852919064527d428e62f03ab4d Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 14 Oct 2014 15:36:43 +0200 Subject: [PATCH 17/18] add more test for presence --- tester/presence_tester.c | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/tester/presence_tester.c b/tester/presence_tester.c index a1a1b6b63..ca3c8c18e 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -347,6 +347,62 @@ static void presence_information(void) { linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } +#define USE_PRESENCE_SERVER 0 + +#if USE_PRESENCE_SERVER +static void test_subscribe_notify_publish(void) { + + LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneProxyConfig* proxy; + LinphonePresenceModel* presence; + + LpConfig *pauline_lp = linphone_core_get_config(pauline->lc); + char* lf_identity=linphone_address_as_string_uri_only(marie->identity); + LinphoneFriend *lf = linphone_core_create_friend_with_address(pauline->lc,lf_identity); + + lp_config_set_int(pauline_lp,"sip","subscribe_expires",5); + + linphone_core_add_friend(pauline->lc,lf); + + /*wait for subscribe acknowledgment*/ + wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_NotifyReceived,1,2000); + CU_ASSERT_EQUAL(LinphoneStatusOffline,linphone_friend_get_status(lf)); + + /*enable publish*/ + + linphone_core_get_default_proxy(marie->lc,&proxy); + linphone_proxy_config_edit(proxy); + + linphone_proxy_config_enable_publish(proxy,TRUE); + linphone_proxy_config_set_publish_expires(proxy,3); + linphone_proxy_config_done(proxy); + + /*wait for marie status*/ + wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_NotifyReceived,2,2000); + CU_ASSERT_EQUAL(LinphoneStatusOnline,linphone_friend_get_status(lf)); + + presence =linphone_presence_model_new_with_activity(LinphonePresenceActivityOffline,NULL); + linphone_core_set_presence_model(marie->lc,presence); + + /*wait for new status*/ + wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_NotifyReceived,3,2000); + CU_ASSERT_EQUAL(LinphonePresenceActivityOffline,linphone_friend_get_status(lf)); + + /*wait for refresh*/ + wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_NotifyReceived,4,5000); + CU_ASSERT_EQUAL(LinphonePresenceActivityOffline,linphone_friend_get_status(lf)); + + //linphone_core_remove_friend(pauline->lc,lf); + /*wait for final notify*/ + //wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_NotifyReceived,4,5000); + //CU_ASSERT_EQUAL(LinphonePresenceActivityOffline,linphone_friend_get_status(lf)); + + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); +} + +#endif test_t presence_tests[] = { { "Simple Subscribe", simple_subscribe }, @@ -356,6 +412,9 @@ test_t presence_tests[] = { { "Unsubscribe while subscribing", unsubscribe_while_subscribing }, { "Presence information", presence_information }, { "App managed presence failure", subscribe_failure_handle_by_app }, +#if USE_PRESENCE_SERVER + { "Subscribe with late publish", test_subscribe_notify_publish }, +#endif }; test_suite_t presence_test_suite = { From 182d7989d8f4426c2a78e548647f00d57040c98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 14 Oct 2014 16:05:52 +0200 Subject: [PATCH 18/18] Add a window ID parameter to LinphoneCore.createFilePlayer() --- java/common/org/linphone/core/LinphoneCore.java | 2 +- java/impl/org/linphone/core/LinphoneCoreImpl.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 26b721675..dfa2f6bca 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -1786,7 +1786,7 @@ public interface LinphoneCore { * Create a media player * @return An object that implement LinphonePlayer */ - public LinphonePlayer createPlayer(); + public LinphonePlayer createPlayer(AndroidVideoWindowImpl window); /** * Destroy a player diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 8bd3f0d7e..750ec1903 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -25,6 +25,7 @@ import java.io.IOException; import org.linphone.core.LinphoneCall.State; import org.linphone.mediastream.Log; +import org.linphone.mediastream.video.AndroidVideoWindowImpl; import org.linphone.mediastream.video.capture.hwconf.Hacks; import android.content.Context; @@ -1279,12 +1280,12 @@ class LinphoneCoreImpl implements LinphoneCore { return getFileTransferServer(nativePtr); } - private native long createPlayer(long nativePtr); + private native long createPlayer(long nativePtr, AndroidVideoWindowImpl window); @Override - public synchronized LinphonePlayer createPlayer() { - long player = createPlayer(nativePtr); - if(player != 0) { - return new LinphonePlayerImpl(createPlayer(nativePtr)); + public synchronized LinphonePlayer createPlayer(AndroidVideoWindowImpl window) { + long playerPtr = createPlayer(nativePtr, window); + if(playerPtr != 0) { + return new LinphonePlayerImpl(playerPtr); } else { return null; }