From 98c4a9bb5e893ff6eac575d150971a4daf71c967 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 12 Sep 2011 22:42:53 +0200 Subject: [PATCH 1/6] wip - conferencing --- coreapi/Makefile.am | 3 +- coreapi/conference.c | 108 ++++++++++++++ coreapi/linphonecall.c | 320 ++++++++++++++++++++++------------------- coreapi/linphonecore.c | 16 ++- coreapi/linphonecore.h | 5 +- coreapi/private.h | 24 +++- mediastreamer2 | 2 +- 7 files changed, 316 insertions(+), 162 deletions(-) create mode 100644 coreapi/conference.c diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index 6ea151e0a..e9cfe715b 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -36,7 +36,8 @@ liblinphone_la_SOURCES=\ sipsetup.c sipsetup.h \ siplogin.c \ lsd.c linphonecore_utils.h \ - ec-calibrator.c + ec-calibrator.c \ + conference.c liblinphone_la_LDFLAGS= -version-info $(LIBLINPHONE_SO_VERSION) -no-undefined diff --git a/coreapi/conference.c b/coreapi/conference.c new file mode 100644 index 000000000..e97f2588c --- /dev/null +++ b/coreapi/conference.c @@ -0,0 +1,108 @@ +/*************************************************************************** + * conference.c + * + * Mon Sep 12, 2011 + * Copyright 2011 Belledonne Communications + * Author: Simon Morlat + * Email simon dot morlat at linphone dot 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" + + +static void conference_check_init(LinphoneConference *ctx){ + if (ctx->conf==NULL){ + ctx->conf=ms_audio_conference_new(); + } +} + +static void conference_check_uninit(LinphoneConference *ctx){ + if (ctx->conf){ + if (ctx->conf->nmembers==0){ + ms_audio_conference_destroy(ctx->conf); + ctx->conf=NULL; + } + } +} + + +void linphone_call_add_to_conf(LinphoneCall *call){ + LinphoneCore *lc=call->core; + LinphoneConference *conf=&lc->conf_ctx; + MSAudioEndpoint *ep; + ep=ms_audio_endpoint_get_from_stream(call->audiostream,TRUE); + ms_audio_conference_add_member(conf->conf,ep); + call->endpoint=ep; +} + +void linphone_call_remove_from_conf(LinphoneCall *call){ + LinphoneCore *lc=call->core; + LinphoneConference *conf=&lc->conf_ctx; + + ms_audio_conference_remove_member(conf->conf,call->endpoint); + ms_audio_endpoint_release_from_stream(call->endpoint); + call->endpoint=NULL; + conference_check_uninit(conf); +} + +int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call){ + LinphoneCallParams params; + if (call->current_params.in_conference){ + ms_error("Already in conference"); + return -1; + } + conference_check_init(&lc->conf_ctx); + call->params.in_conference=TRUE; + call->params.has_video=FALSE; + params=call->params; + if (call->state==LinphoneCallPaused) + linphone_core_resume_call(lc,call); + else if (call->state==LinphoneCallStreamsRunning){ + /*this will trigger a reINVITE that will later redraw the streams */ + linphone_core_update_call(lc,call,¶ms); + }else{ + ms_error("Call is in state %s, it cannot be added to the conference.",linphone_call_state_to_string(call->state)); + return -1; + } + return 0; +} + +int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call){ + if (!call->current_params.in_conference){ + if (call->params.in_conference){ + ms_warning("Not (yet) in conference, be patient"); + return -1; + }else{ + ms_error("Not in a conference."); + return -1; + } + } + call->params.in_conference=FALSE; + return linphone_core_pause_call(lc,call); +} + +int linphone_core_pause_conference(LinphoneCore *lc){ + return 0; +} + + +int linphone_core_resume_conference(LinphoneCore *lc){ + return 0; +} + diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 210c2c453..80f681f44 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -834,10 +834,7 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){ } } - -static void post_configure_audio_streams(LinphoneCall*call){ - AudioStream *st=call->audiostream; - LinphoneCore *lc=call->core; +static void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t muted){ float mic_gain=lp_config_get_float(lc->config,"sound","mic_gain",1); float thres = 0; float recv_gain; @@ -845,7 +842,7 @@ static void post_configure_audio_streams(LinphoneCall*call){ float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0); int dc_removal=lp_config_get_int(lc->config,"sound","dc_removal",0); - if (!call->audio_muted) + if (!muted) audio_stream_set_mic_gain(st,mic_gain); else audio_stream_set_mic_gain(st,0); @@ -884,6 +881,12 @@ static void post_configure_audio_streams(LinphoneCall*call){ ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&floorgain); } parametrize_equalizer(lc,st); +} + +static void post_configure_audio_streams(LinphoneCall*call){ + AudioStream *st=call->audiostream; + LinphoneCore *lc=call->core; + _post_configure_audio_stream(st,lc,call->audio_muted); if (lc->vtable.dtmf_received!=NULL){ /* replace by our default action*/ audio_stream_play_received_dtmfs(call->audiostream,FALSE); @@ -953,18 +956,167 @@ static void setup_ring_player(LinphoneCore *lc, LinphoneCall *call){ ms_filter_call_method(call->audiostream->soundread,MS_FILE_PLAYER_LOOP,&pause_time); } +#define LINPHONE_RTCP_SDES_TOOL "Linphone-" LINPHONE_VERSION + +static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cname, bool_t muted, bool_t send_ringbacktone, bool_t use_arc){ + LinphoneCore *lc=call->core; + int jitt_comp=lc->rtp_conf.audio_jitt_comp; + int used_pt=-1; + const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc, + SalProtoRtpAvp,SalAudio); + + if (stream && stream->dir!=SalStreamInactive && stream->port!=0){ + MSSndCard *playcard=lc->sound_conf.lsd_card ? + lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard; + MSSndCard *captcard=lc->sound_conf.capt_sndcard; + const char *playfile=lc->play_file; + const char *recfile=lc->rec_file; + call->audio_profile=make_profile(call,call->resultdesc,stream,&used_pt); + bool_t use_ec; + + if (used_pt!=-1){ + if (playcard==NULL) { + ms_warning("No card defined for playback !"); + } + if (captcard==NULL) { + ms_warning("No card defined for capture !"); + } + /*Replace soundcard filters by inactive file players or recorders + when placed in recvonly or sendonly mode*/ + if (stream->port==0 || stream->dir==SalStreamRecvOnly){ + captcard=NULL; + playfile=NULL; + }else if (stream->dir==SalStreamSendOnly){ + playcard=NULL; + captcard=NULL; + recfile=NULL; + /*And we will eventually play "playfile" if set by the user*/ + /*playfile=NULL;*/ + } + if (send_ringbacktone){ + captcard=NULL; + playfile=NULL;/* it is setup later*/ + } + /*if playfile are supplied don't use soundcards*/ + if (lc->use_files) { + captcard=NULL; + playcard=NULL; + } + if (call->params.in_conference){ + /* first create the graph without soundcard resources*/ + captcard=playcard=NULL; + } + use_ec=captcard==NULL ? FALSE : linphone_core_echo_cancellation_enabled(lc); + + audio_stream_enable_adaptive_bitrate_control(call->audiostream,use_arc); + audio_stream_start_full( + call->audiostream, + call->audio_profile, + stream->addr[0]!='\0' ? stream->addr : call->resultdesc->addr, + stream->port, + stream->port+1, + used_pt, + jitt_comp, + playfile, + recfile, + playcard, + captcard, + use_ec + ); + post_configure_audio_streams(call); + if (muted && !send_ringbacktone){ + audio_stream_set_mic_gain(call->audiostream,0); + } + if (stream->dir==SalStreamSendOnly && playfile!=NULL){ + int pause_time=500; + ms_filter_call_method(call->audiostream->soundread,MS_FILE_PLAYER_LOOP,&pause_time); + } + if (send_ringbacktone){ + setup_ring_player(lc,call); + } + audio_stream_set_rtcp_information(call->audiostream, cname, LINPHONE_RTCP_SDES_TOOL); + if (call->params.in_conference){ + /*transform the graph to connect it to the conference filter */ + linphone_call_add_to_conf(call); + } + }else ms_warning("No audio stream accepted ?"); + } +} + +static void linphone_call_start_video_stream(LinphoneCall *call, const char *cname,bool_t all_inputs_muted){ +#ifdef VIDEO_ENABLED + LinphoneCore *lc=call->core; + int used_pt=-1; + const SalStreamDescription *vstream=sal_media_description_find_stream(call->resultdesc, + SalProtoRtpAvp,SalVideo); + /* shutdown preview */ + if (lc->previewstream!=NULL) { + video_preview_stop(lc->previewstream); + lc->previewstream=NULL; + } + call->current_params.has_video=FALSE; + if (vstream && vstream->dir!=SalStreamInactive && vstream->port!=0) { + const char *addr=vstream->addr[0]!='\0' ? vstream->addr : call->resultdesc->addr; + call->video_profile=make_profile(call,call->resultdesc,vstream,&used_pt); + if (used_pt!=-1){ + VideoStreamDir dir=VideoStreamSendRecv; + MSWebCam *cam=lc->video_conf.device; + bool_t is_inactive=FALSE; + + call->current_params.has_video=TRUE; + + video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc)); + video_stream_enable_self_view(call->videostream,lc->video_conf.selfview); + if (lc->video_window_id!=0) + video_stream_set_native_window_id(call->videostream,lc->video_window_id); + if (lc->preview_window_id!=0) + video_stream_set_native_preview_window_id (call->videostream,lc->preview_window_id); + video_stream_use_preview_video_window (call->videostream,lc->use_preview_window); + + if (vstream->dir==SalStreamSendOnly && lc->video_conf.capture ){ + cam=get_nowebcam_device(); + dir=VideoStreamSendOnly; + }else if (vstream->dir==SalStreamRecvOnly && lc->video_conf.display ){ + dir=VideoStreamRecvOnly; + }else if (vstream->dir==SalStreamSendRecv){ + if (lc->video_conf.display && lc->video_conf.capture) + dir=VideoStreamSendRecv; + else if (lc->video_conf.display) + dir=VideoStreamRecvOnly; + else + dir=VideoStreamSendOnly; + }else{ + ms_warning("video stream is inactive."); + /*either inactive or incompatible with local capabilities*/ + is_inactive=TRUE; + } + if (call->camera_active==FALSE || all_inputs_muted){ + cam=get_nowebcam_device(); + } + if (!is_inactive){ + video_stream_set_direction (call->videostream, dir); + video_stream_start(call->videostream, + call->video_profile, addr, vstream->port, + vstream->port+1, + used_pt, lc->rtp_conf.audio_jitt_comp, cam); + video_stream_set_rtcp_information(call->videostream, cname,LINPHONE_RTCP_SDES_TOOL); + } + }else ms_warning("No video stream accepted."); + }else{ + ms_warning("No valid video stream defined."); + } +#endif +} void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_muted, bool_t send_ringbacktone){ LinphoneCore *lc=call->core; LinphoneAddress *me=linphone_core_get_primary_contact_parsed(lc); - const char *tool="linphone-" LINPHONE_VERSION; char *cname; - int used_pt=-1; + bool_t use_arc; #ifdef VIDEO_ENABLED const SalStreamDescription *vstream=sal_media_description_find_stream(call->resultdesc, SalProtoRtpAvp,SalVideo); #endif - bool_t use_arc=linphone_core_adaptive_rate_control_enabled(lc); if(call->audiostream == NULL) { @@ -972,155 +1124,18 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut return; } call->current_params = call->params; - /* adjust rtp jitter compensation. It must be at least the latency of the sound card */ - int jitt_comp=MAX(lc->sound_conf.latency,lc->rtp_conf.audio_jitt_comp); - if (call->media_start_time==0) call->media_start_time=time(NULL); - cname=linphone_address_as_string_uri_only(me); - { - const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc, - SalProtoRtpAvp,SalAudio); - if (stream && stream->dir!=SalStreamInactive && stream->port!=0){ - MSSndCard *playcard=lc->sound_conf.lsd_card ? - lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard; - MSSndCard *captcard=lc->sound_conf.capt_sndcard; - const char *playfile=lc->play_file; - const char *recfile=lc->rec_file; - call->audio_profile=make_profile(call,call->resultdesc,stream,&used_pt); - bool_t use_ec,use_arc_audio=use_arc; - if (used_pt!=-1){ - if (playcard==NULL) { - ms_warning("No card defined for playback !"); - } - if (captcard==NULL) { - ms_warning("No card defined for capture !"); - } - /*Replace soundcard filters by inactive file players or recorders - when placed in recvonly or sendonly mode*/ - if (stream->port==0 || stream->dir==SalStreamRecvOnly){ - captcard=NULL; - playfile=NULL; - }else if (stream->dir==SalStreamSendOnly){ - playcard=NULL; - captcard=NULL; - recfile=NULL; - /*And we will eventually play "playfile" if set by the user*/ - /*playfile=NULL;*/ - } - if (send_ringbacktone){ - captcard=NULL; - playfile=NULL;/* it is setup later*/ - } - /*if playfile are supplied don't use soundcards*/ - if (lc->use_files) { - captcard=NULL; - playcard=NULL; - } - use_ec=captcard==NULL ? FALSE : linphone_core_echo_cancellation_enabled(lc); #if defined(VIDEO_ENABLED) - if (vstream && vstream->dir!=SalStreamInactive && vstream->payloads!=NULL){ - /*when video is used, do not make adaptive rate control on audio, it is stupid.*/ - use_arc_audio=FALSE; - #if defined(ANDROID) - /*On android we have to disable the echo canceller to preserve CPU for video codecs */ - use_ec=FALSE; - #endif - } -#endif - audio_stream_enable_adaptive_bitrate_control(call->audiostream,use_arc_audio); - audio_stream_start_full( - call->audiostream, - call->audio_profile, - stream->addr[0]!='\0' ? stream->addr : call->resultdesc->addr, - stream->port, - stream->port+1, - used_pt, - jitt_comp, - playfile, - recfile, - playcard, - captcard, - use_ec - ); - post_configure_audio_streams(call); - if (all_inputs_muted && !send_ringbacktone){ - audio_stream_set_mic_gain(call->audiostream,0); - } - if (stream->dir==SalStreamSendOnly && playfile!=NULL){ - int pause_time=500; - ms_filter_call_method(call->audiostream->soundread,MS_FILE_PLAYER_LOOP,&pause_time); - } - if (send_ringbacktone){ - setup_ring_player(lc,call); - } - audio_stream_set_rtcp_information(call->audiostream, cname, tool); - }else ms_warning("No audio stream accepted ?"); - } + if (vstream && vstream->dir!=SalStreamInactive && vstream->payloads!=NULL){ + /*when video is used, do not make adaptive rate control on audio, it is stupid.*/ + use_arc=FALSE; } -#ifdef VIDEO_ENABLED - { - - used_pt=-1; - /* shutdown preview */ - if (lc->previewstream!=NULL) { - video_preview_stop(lc->previewstream); - lc->previewstream=NULL; - } - call->current_params.has_video=FALSE; - if (vstream && vstream->dir!=SalStreamInactive && vstream->port!=0) { - const char *addr=vstream->addr[0]!='\0' ? vstream->addr : call->resultdesc->addr; - call->video_profile=make_profile(call,call->resultdesc,vstream,&used_pt); - if (used_pt!=-1){ - VideoStreamDir dir=VideoStreamSendRecv; - MSWebCam *cam=lc->video_conf.device; - bool_t is_inactive=FALSE; +#endif + linphone_call_start_audio_stream(call,cname,all_inputs_muted,send_ringbacktone,use_arc); + linphone_call_start_video_stream(call,cname,all_inputs_muted); - call->current_params.has_video=TRUE; - - video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc)); - video_stream_enable_self_view(call->videostream,lc->video_conf.selfview); - if (lc->video_window_id!=0) - video_stream_set_native_window_id(call->videostream,lc->video_window_id); - if (lc->preview_window_id!=0) - video_stream_set_native_preview_window_id (call->videostream,lc->preview_window_id); - video_stream_use_preview_video_window (call->videostream,lc->use_preview_window); - - if (vstream->dir==SalStreamSendOnly && lc->video_conf.capture ){ - cam=get_nowebcam_device(); - dir=VideoStreamSendOnly; - }else if (vstream->dir==SalStreamRecvOnly && lc->video_conf.display ){ - dir=VideoStreamRecvOnly; - }else if (vstream->dir==SalStreamSendRecv){ - if (lc->video_conf.display && lc->video_conf.capture) - dir=VideoStreamSendRecv; - else if (lc->video_conf.display) - dir=VideoStreamRecvOnly; - else - dir=VideoStreamSendOnly; - }else{ - ms_warning("video stream is inactive."); - /*either inactive or incompatible with local capabilities*/ - is_inactive=TRUE; - } - if (call->camera_active==FALSE || all_inputs_muted){ - cam=get_nowebcam_device(); - } - if (!is_inactive){ - video_stream_set_direction (call->videostream, dir); - video_stream_start(call->videostream, - call->video_profile, addr, vstream->port, - vstream->port+1, - used_pt, jitt_comp, cam); - video_stream_set_rtcp_information(call->videostream, cname,tool); - } - }else ms_warning("No video stream accepted."); - }else{ - ms_warning("No valid video stream defined."); - } - } -#endif call->all_muted=all_inputs_muted; call->playing_ringbacktone=send_ringbacktone; call->up_bw=linphone_core_get_upload_bandwidth(lc); @@ -1158,6 +1173,9 @@ void linphone_call_stop_media_streams(LinphoneCall *call){ } } linphone_call_log_fill_stats (call->log,call->audiostream); + if (call->endpoint){ + linphone_call_remove_from_conf(call); + } audio_stream_stop(call->audiostream); call->audiostream=NULL; } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 6abe85101..17cb06d9d 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2219,13 +2219,20 @@ bool_t linphone_core_inc_invite_pending(LinphoneCore*lc){ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){ int err=0; if (params!=NULL){ + const char *subject; call->params=*params; update_local_media_description(lc,call,&call->localdesc); call->camera_active=params->has_video; + + if (params->in_conference){ + subject="Conference"; + }else{ + subject="Media change"; + } if (lc->vtable.display_status) lc->vtable.display_status(lc,_("Modifying call parameters...")); sal_call_set_local_media_description (call->op,call->localdesc); - err=sal_call_update(call->op,"Media parameters update"); + err=sal_call_update(call->op,subject); }else{ #ifdef VIDEO_ENABLED if (call->videostream!=NULL){ @@ -2486,8 +2493,7 @@ int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *the_call) ms_error("No reason to pause this call, it is already paused or inactive."); return -1; } - if (sal_call_update(call->op,subject) != 0) - { + if (sal_call_update(call->op,subject) != 0){ if (lc->vtable.display_warning) lc->vtable.display_warning(lc,_("Could not pause the call")); } @@ -2524,6 +2530,7 @@ int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *the_call) { char temp[255]={0}; LinphoneCall *call = the_call; + const char *subject="Call resuming"; if(call->state!=LinphoneCallPaused ){ ms_warning("we cannot resume a call that has not been established and paused before"); @@ -2537,7 +2544,8 @@ int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *the_call) } ms_message("Resuming call %p",call); sal_media_description_set_dir(call->localdesc,SalStreamSendRecv); - if(sal_call_update(call->op,"Call resuming") != 0){ + if (call->params.in_conference) subject="Resuming conference"; + if(sal_call_update(call->op,subject) != 0){ return -1; } linphone_call_set_state (call,LinphoneCallResuming,"Resuming"); diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 010b15851..b2b09f855 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1023,7 +1023,10 @@ bool_t linphone_call_are_all_streams_encrypted(LinphoneCall *call); const char* linphone_call_get_authentication_token(LinphoneCall *call); bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call); - +int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call); +int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call); +int linphone_core_pause_conference(LinphoneCore *lc); +int linphone_core_resume_conference(LinphoneCore *lc); #ifdef __cplusplus diff --git a/coreapi/private.h b/coreapi/private.h index 373079885..e5ce1fd0d 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -33,6 +33,7 @@ #include "config.h" #endif #include "mediastreamer2/mediastream.h" +#include "mediastreamer2/msconference.h" #ifndef LIBLINPHONE_VERSION #define LIBLINPHONE_VERSION LINPHONE_VERSION @@ -62,7 +63,8 @@ struct _LinphoneCallParams{ int audio_bw; /* bandwidth limit for audio stream */ bool_t has_video; bool_t real_early_media; /*send real media even during early media (for outgoing calls)*/ - bool_t pad[2]; + bool_t in_conference; /*in conference mode */ + bool_t pad; }; struct _LinphoneCall @@ -87,6 +89,7 @@ struct _LinphoneCall int video_port; struct _AudioStream *audiostream; /**/ struct _VideoStream *videostream; + MSAudioEndpoint *endpoint; /*used for conferencing*/ char *refer_to; LinphoneCallParams params; LinphoneCallParams current_params; @@ -99,12 +102,13 @@ struct _LinphoneCall bool_t all_muted; /*this flag is set during early medias*/ bool_t playing_ringbacktone; bool_t owns_call_log; + bool_t pad; OrtpEvQueue *audiostream_app_evq; - bool_t audiostream_encrypted; char *auth_token; - bool_t auth_token_verified; OrtpEvQueue *videostream_app_evq; bool_t videostream_encrypted; + bool_t audiostream_encrypted; + bool_t auth_token_verified; }; @@ -388,6 +392,13 @@ typedef struct autoreplier_config const char *message; /* the path of the file to be played */ }autoreplier_config_t; +struct _LinphoneConference{ + MSAudioConference *conf; + AudioStream *local_participant; + MSAudioEndpoint *local_endpoint; +}; + +typedef struct _LinphoneConference LinphoneConference; struct _LinphoneCore { @@ -439,6 +450,8 @@ struct _LinphoneCore time_t netup_time; /*time when network went reachable */ struct _EcCalibrator *ecc; MSList *hooks; + LinphoneConference conf_ctx; + char* zrtp_secrets_cache; bool_t use_files; bool_t apply_nat_settings; bool_t initial_subscribes_sent; @@ -448,7 +461,6 @@ struct _LinphoneCore bool_t network_reachable; bool_t use_preview_window; bool_t ringstream_autorelease; - char* zrtp_secrets_cache; }; bool_t linphone_core_can_we_add_call(LinphoneCore *lc); @@ -493,6 +505,10 @@ void ec_calibrator_destroy(EcCalibrator *ecc); void linphone_call_background_tasks(LinphoneCall *call, bool_t one_second_elapsed); +/*conferencing subsystem*/ +void linphone_call_add_to_conf(LinphoneCall *call); +void linphone_call_remove_from_conf(LinphoneCall *call); + #define HOLD_OFF (0) #define HOLD_ON (1) diff --git a/mediastreamer2 b/mediastreamer2 index a82dcdbf8..a8ca8f204 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit a82dcdbf8a4e8364bdcaa6f6fb88ca087f48a780 +Subproject commit a8ca8f204ca57d18f6e1c0515adaf7edb0c905dd From 41029c78b13f62975fc6cee3658cfe28b9de6007 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 13 Sep 2011 14:43:20 +0200 Subject: [PATCH 2/6] conferencing in progress --- console/commands.c | 30 +++++++++++++++++++++++++++--- coreapi/linphonecall.c | 9 ++++++++- coreapi/linphonecore.c | 19 ++++++++++--------- coreapi/linphonecore.h | 1 + mediastreamer2 | 2 +- 5 files changed, 47 insertions(+), 14 deletions(-) diff --git a/console/commands.c b/console/commands.c index 32482bad7..27ea8dc5c 100644 --- a/console/commands.c +++ b/console/commands.c @@ -102,6 +102,7 @@ static int lpc_cmd_vfureq(LinphoneCore *lc, char *arg); static int lpc_cmd_states(LinphoneCore *lc, char *args); static int lpc_cmd_identify(LinphoneCore *lc, char *args); static int lpc_cmd_ringback(LinphoneCore *lc, char *args); +static int lpc_cmd_conference(LinphoneCore *lc, char *args); /* Command handler helpers */ static void linphonec_proxy_add(LinphoneCore *lc); @@ -124,7 +125,6 @@ static void linphonec_codec_enable(int type, LinphoneCore *lc, int index); static void linphonec_codec_disable(int type, LinphoneCore *lc, int index); - /* Command table management */ static LPC_COMMAND *lpc_find_command(const char *name); @@ -184,6 +184,10 @@ static LPC_COMMAND commands[] = { "'transfer ': transfers the call with 'id' to the destination sip-uri\n" "'transfer --to-call ': transfers the call with 'id1' to the destination of call 'id2' (attended transfer)\n" }, + { "conference", lpc_cmd_conference, "Create and manage an audio conference.", + "'conference add : join the call with id 'call id' into the audio conference." + "'conference rm : remove the call with id 'call id' from the audio conference." + }, { "mute", lpc_cmd_mute_mic, "Mute microphone and suspend voice transmission."}, #ifdef VIDEO_ENABLED @@ -1461,6 +1465,24 @@ static int lpc_cmd_resume(LinphoneCore *lc, char *args){ } +static int lpc_cmd_conference(LinphoneCore *lc, char *args){ + long id; + char subcommand[32]={0}; + int n; + if (args==NULL) return 0; + n=sscanf(args, "%31s %li", subcommand,&id); + if (n == 2){ + LinphoneCall *call=linphonec_get_call(id); + if (call==NULL) return 1; + if (strcmp(subcommand,"add")==0){ + linphone_core_add_to_conference(lc,call); + }else if (strcmp(subcommand,"rm")==0){ + linphone_core_remove_from_conference(lc,call); + } + } + return 0; +} + /*************************************************************************** * * Commands helper functions @@ -2411,9 +2433,11 @@ static void lpc_display_call_states(LinphoneCore *lc){ }else{ for(;elem!=NULL;elem=elem->next){ call=(LinphoneCall*)elem->data; + bool_t in_conference=linphone_call_params_local_conference_mode(linphone_call_get_current_params(call)); tmp=linphone_call_get_remote_address_as_string (call); - linphonec_out("%-2i | %-35s | %s\n",(int)(long)linphone_call_get_user_pointer(call), - tmp,linphone_call_state_to_string(linphone_call_get_state(call))); + linphonec_out("%-2i | %-35s | %s %s\n",(int)(long)linphone_call_get_user_pointer(call), + tmp,linphone_call_state_to_string(linphone_call_get_state(call)), + in_conference ? "(conferencing)" : ""); ms_free(tmp); } } diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 80f681f44..a568b8ba9 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -680,6 +680,13 @@ bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallParams return cp->real_early_media; } +/** + * Returns true if the call is part of the locally managed conference. +**/ +bool_t linphone_call_params_local_conference_mode(const LinphoneCallParams *cp){ + return cp->in_conference; +} + /** * Refine bandwidth settings for this call by setting a bandwidth limit for audio streams. * As a consequence, codecs whose bitrates are not compatible with this limit won't be used. @@ -1405,7 +1412,7 @@ void linphone_call_background_tasks(LinphoneCall *call, bool_t one_second_elapse } } } - if (one_second_elapsed && call->audiostream!=NULL && disconnect_timeout>0 ) + if (call->state==LinphoneCallStreamsRunning && one_second_elapsed && call->audiostream!=NULL && disconnect_timeout>0 ) disconnected=!audio_stream_alive(call->audiostream,disconnect_timeout); if (disconnected) linphone_core_disconnected(call->core,call); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 17cb06d9d..1d985f544 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1725,6 +1725,7 @@ void linphone_core_iterate(LinphoneCore *lc){ we are going to examine is destroy and removed during linphone_core_start_invite() */ calls=calls->next; + linphone_call_background_tasks(call,one_second_elapsed); if (call->state==LinphoneCallOutgoingInit && (curtime-call->start_time>=2)){ /*start the call even if the OPTIONS reply did not arrive*/ linphone_core_start_invite(lc,call,NULL); @@ -1738,9 +1739,7 @@ void linphone_core_iterate(LinphoneCore *lc){ } } } - call = linphone_core_get_current_call(lc); - if(call) - linphone_call_background_tasks(call,one_second_elapsed); + if (linphone_core_video_preview_enabled(lc)){ if (lc->previewstream==NULL && lc->calls==NULL) toggle_video_preview(lc,TRUE); @@ -2536,13 +2535,15 @@ int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *the_call) ms_warning("we cannot resume a call that has not been established and paused before"); return -1; } - if(linphone_core_get_current_call(lc) != NULL){ - ms_warning("There is already a call in process, pause or stop it first."); - if (lc->vtable.display_warning) - lc->vtable.display_warning(lc,_("There is already a call in process, pause or stop it first.")); - return -1; + if (call->params.in_conference==FALSE){ + if(linphone_core_get_current_call(lc) != NULL){ + ms_warning("There is already a call in process, pause or stop it first."); + if (lc->vtable.display_warning) + lc->vtable.display_warning(lc,_("There is already a call in process, pause or stop it first.")); + return -1; + } + ms_message("Resuming call %p",call); } - ms_message("Resuming call %p",call); sal_media_description_set_dir(call->localdesc,SalStreamSendRecv); if (call->params.in_conference) subject="Resuming conference"; if(sal_call_update(call->op,subject) != 0){ diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index b2b09f855..e0f3145ff 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -181,6 +181,7 @@ void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled); bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp); void linphone_call_params_enable_early_media_sending(LinphoneCallParams *cp, bool_t enabled); bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallParams *cp); +bool_t linphone_call_params_local_conference_mode(const LinphoneCallParams *cp); void linphone_call_params_set_audio_bandwidth_limit(LinphoneCallParams *cp, int bw); void linphone_call_params_destroy(LinphoneCallParams *cp); diff --git a/mediastreamer2 b/mediastreamer2 index a8ca8f204..228168085 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit a8ca8f204ca57d18f6e1c0515adaf7edb0c905dd +Subproject commit 22816808514255867ae8fa5347b854f4570784f7 From 0a9e2d37388439bfcdbe9d386d39a003a4ffa030 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 13 Sep 2011 21:40:35 +0200 Subject: [PATCH 3/6] audio conferencing is working. Not all cases are tested yet. --- console/commands.c | 67 +++++++++++------------------------------- coreapi/callbacks.c | 1 + coreapi/conference.c | 55 ++++++++++++++++++++++++++++++++-- coreapi/linphonecall.c | 2 +- coreapi/linphonecore.c | 4 +-- coreapi/linphonecore.h | 5 ++-- coreapi/private.h | 1 + 7 files changed, 78 insertions(+), 57 deletions(-) diff --git a/console/commands.c b/console/commands.c index 27ea8dc5c..84639ada8 100644 --- a/console/commands.c +++ b/console/commands.c @@ -123,7 +123,7 @@ static int linphonec_friend_delete(LinphoneCore *lc, int num); static void linphonec_codec_list(int type, LinphoneCore *lc); static void linphonec_codec_enable(int type, LinphoneCore *lc, int index); static void linphonec_codec_disable(int type, LinphoneCore *lc, int index); - +static void lpc_display_call_states(LinphoneCore *lc); /* Command table management */ static LPC_COMMAND *lpc_find_command(const char *name); @@ -527,37 +527,6 @@ lpc_cmd_help(LinphoneCore *lc, char *arg) static char callee_name[256]={0}; static char caller_name[256]={0}; -static const char *get_call_status(LinphoneCall *call){ - switch(linphone_call_get_state(call)){ - case LinphoneCallPaused: - if (linphone_call_get_refer_to (call)!=NULL){ - return "Paused (transfered)"; - }else{ - return "Paused"; - } - break; - case LinphoneCallPausedByRemote: - return "Paused by remote"; - break; - case LinphoneCallIncomingReceived: - return "Pending"; - break; - case LinphoneCallOutgoingInit: - case LinphoneCallOutgoingProgress: - return "Dialing out"; - break; - case LinphoneCallOutgoingEarlyMedia: - case LinphoneCallOutgoingRinging: - return "Remote ringing"; - break; - default: - if (linphone_call_has_transfer_pending(call)){ - return "Running (transfer pending)"; - }else - return "Running"; - } - return ""; -} static int lpc_cmd_call(LinphoneCore *lc, char *args) @@ -603,19 +572,7 @@ lpc_cmd_calls(LinphoneCore *lc, char *args){ const MSList *calls = linphone_core_get_calls(lc); if(calls) { - const MSList *p_calls = calls; - linphonec_out("ID\t\tDestination\t\t\t\tStatus\n---------------------------------------------------------------------\n"); - while(p_calls != NULL) - { - LinphoneCall *call=(LinphoneCall*)p_calls->data; - char *tmp=linphone_call_get_remote_address_as_string(call); - linphonec_out("%li\t%s\t\t\t%s\r\n", - (long)linphone_call_get_user_pointer (call), - tmp, - get_call_status(call)); - p_calls = p_calls->next; - ms_free(tmp); - } + lpc_display_call_states(lc); }else { linphonec_out("No active call.\n"); @@ -1476,8 +1433,16 @@ static int lpc_cmd_conference(LinphoneCore *lc, char *args){ if (call==NULL) return 1; if (strcmp(subcommand,"add")==0){ linphone_core_add_to_conference(lc,call); + return 1; }else if (strcmp(subcommand,"rm")==0){ linphone_core_remove_from_conference(lc,call); + return 1; + }else if (strcmp(subcommand,"enter")==0){ + linphone_core_enter_conference(lc); + return 1; + }else if (strcmp(subcommand,"leave")==0){ + linphone_core_leave_conference(lc); + return 1; } } return 0; @@ -2425,19 +2390,21 @@ static void lpc_display_call_states(LinphoneCore *lc){ const MSList *elem; char *tmp; linphonec_out("Call states\n" - "Id | Destination | State\n" - "---------------------------------------------------------------\n"); + "Id | Destination | State | Flags |\n" + "------------------------------------------------------------------------\n"); elem=linphone_core_get_calls(lc); if (elem==NULL){ linphonec_out("(empty)\n"); }else{ for(;elem!=NULL;elem=elem->next){ + const char *flag; call=(LinphoneCall*)elem->data; bool_t in_conference=linphone_call_params_local_conference_mode(linphone_call_get_current_params(call)); tmp=linphone_call_get_remote_address_as_string (call); - linphonec_out("%-2i | %-35s | %s %s\n",(int)(long)linphone_call_get_user_pointer(call), - tmp,linphone_call_state_to_string(linphone_call_get_state(call)), - in_conference ? "(conferencing)" : ""); + flag=in_conference ? "conferencing" : ""; + flag=linphone_call_has_transfer_pending(call) ? "transfer pending" : flag; + linphonec_out("%-2i | %-35s | %-15s | %s\n",(int)(long)linphone_call_get_user_pointer(call), + tmp,linphone_call_state_to_string(linphone_call_get_state(call))+strlen("LinphoneCall"),flag); ms_free(tmp); } } diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index a101dbc8e..1f00b1995 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static void register_failure(SalOp *op, SalError error, SalReason reason, const char *details); static bool_t media_parameters_changed(LinphoneCall *call, SalMediaDescription *oldmd, SalMediaDescription *newmd){ + if (call->params.in_conference!=call->current_params.in_conference) return TRUE; return !sal_media_description_equals(oldmd,newmd) || call->up_bw!=linphone_core_get_upload_bandwidth(call->core); } diff --git a/coreapi/conference.c b/coreapi/conference.c index e97f2588c..c1058233b 100644 --- a/coreapi/conference.c +++ b/coreapi/conference.c @@ -32,9 +32,20 @@ static void conference_check_init(LinphoneConference *ctx){ } } +static void remove_local_endpoint(LinphoneConference *ctx){ + if (ctx->local_endpoint){ + ms_audio_conference_remove_member(ctx->conf,ctx->local_endpoint); + ms_audio_endpoint_release_from_stream(ctx->local_endpoint); + ctx->local_endpoint=NULL; + audio_stream_stop(ctx->local_participant); + ctx->local_participant=NULL; + } +} + static void conference_check_uninit(LinphoneConference *ctx){ if (ctx->conf){ if (ctx->conf->nmembers==0){ + remove_local_endpoint(ctx); ms_audio_conference_destroy(ctx->conf); ctx->conf=NULL; } @@ -61,8 +72,36 @@ void linphone_call_remove_from_conf(LinphoneCall *call){ conference_check_uninit(conf); } +static void add_local_endpoint(LinphoneConference *conf,LinphoneCore *lc){ + /*create a dummy audiostream in order to extract the local part of it */ + /* network address and ports have no meaning and are not used here. */ + AudioStream *st=audio_stream_new(65000,FALSE); + MSSndCard *playcard=lc->sound_conf.lsd_card ? + lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard; + MSSndCard *captcard=lc->sound_conf.capt_sndcard; + + audio_stream_start_full(st, &av_profile, + "127.0.0.1", + 65000, + 65001, + 0, + 40, + NULL, + NULL, + playcard, + captcard, + linphone_core_echo_cancellation_enabled(lc) + ); + _post_configure_audio_stream(st,lc,FALSE); + conf->local_participant=st; + conf->local_endpoint=ms_audio_endpoint_get_from_stream(st,FALSE); + ms_audio_conference_add_member(conf->conf,conf->local_endpoint); +} + int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call){ LinphoneCallParams params; + LinphoneConference *conf=&lc->conf_ctx; + if (call->current_params.in_conference){ ms_error("Already in conference"); return -1; @@ -75,7 +114,10 @@ int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call){ linphone_core_resume_call(lc,call); else if (call->state==LinphoneCallStreamsRunning){ /*this will trigger a reINVITE that will later redraw the streams */ + if (call->audiostream || call->videostream) + linphone_call_stop_media_streams (call); /*free the audio & video local resources*/ linphone_core_update_call(lc,call,¶ms); + add_local_endpoint(conf,lc); }else{ ms_error("Call is in state %s, it cannot be added to the conference.",linphone_call_state_to_string(call->state)); return -1; @@ -97,12 +139,21 @@ int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call){ return linphone_core_pause_call(lc,call); } -int linphone_core_pause_conference(LinphoneCore *lc){ +bool_t linphone_core_is_in_conference(const LinphoneCore *lc){ + return lc->conf_ctx.local_participant!=NULL; +} + +int linphone_core_leave_conference(LinphoneCore *lc){ + LinphoneConference *conf=&lc->conf_ctx; + if (linphone_core_is_in_conference(lc)) + remove_local_endpoint(conf); return 0; } -int linphone_core_resume_conference(LinphoneCore *lc){ +int linphone_core_enter_conference(LinphoneCore *lc){ + LinphoneConference *conf=&lc->conf_ctx; + if (conf->local_participant==NULL) add_local_endpoint(conf,lc); return 0; } diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index a568b8ba9..085cde973 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -841,7 +841,7 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){ } } -static void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t muted){ +void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t muted){ float mic_gain=lp_config_get_float(lc->config,"sound","mic_gain",1); float thres = 0; float recv_gain; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 1d985f544..b042a1398 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2095,7 +2095,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const if (linphone_core_in_call(lc)){ if (lc->vtable.display_warning) - lc->vtable.display_warning(lc,_("Sorry, you have to pause or stop the current call first !")); + lc->vtable.display_warning(lc,_("Sorry, you have to pause or stop the current call or conference first !")); return NULL; } if(!linphone_core_can_we_add_call(lc)){ @@ -2454,7 +2454,7 @@ const MSList *linphone_core_get_calls(LinphoneCore *lc) * @ingroup call_control **/ bool_t linphone_core_in_call(const LinphoneCore *lc){ - return linphone_core_get_current_call((LinphoneCore *)lc)!=NULL; + return linphone_core_get_current_call((LinphoneCore *)lc)!=NULL || linphone_core_is_in_conference(lc); } /** diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index e0f3145ff..dbf698fad 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1026,8 +1026,9 @@ bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call); int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call); int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call); -int linphone_core_pause_conference(LinphoneCore *lc); -int linphone_core_resume_conference(LinphoneCore *lc); +bool_t linphone_core_is_in_conference(const LinphoneCore *lc); +int linphone_core_enter_conference(LinphoneCore *lc); +int linphone_core_leave_conference(LinphoneCore *lc); #ifdef __cplusplus diff --git a/coreapi/private.h b/coreapi/private.h index e5ce1fd0d..bb1fb883b 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -506,6 +506,7 @@ void ec_calibrator_destroy(EcCalibrator *ecc); void linphone_call_background_tasks(LinphoneCall *call, bool_t one_second_elapsed); /*conferencing subsystem*/ +void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t muted); void linphone_call_add_to_conf(LinphoneCall *call); void linphone_call_remove_from_conf(LinphoneCall *call); From b07b784570695a7177c92c89b8fa25cd36da088b Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 14 Sep 2011 10:27:11 +0200 Subject: [PATCH 4/6] Conferencing JNI + Android support. Conflicts: coreapi/conference.c coreapi/linphonecore.h --- build/android/Android.mk | 1 + coreapi/conference.c | 3 ++ coreapi/linphonecore.h | 3 ++ coreapi/linphonecore_jni.cc | 40 +++++++++++++++++++ .../org/linphone/core/LinphoneCall.java | 21 +++++++--- .../org/linphone/core/LinphoneCore.java | 16 +++++++- mediastreamer2 | 2 +- 7 files changed, 78 insertions(+), 8 deletions(-) diff --git a/build/android/Android.mk b/build/android/Android.mk index 1c7a611bf..3946dca89 100755 --- a/build/android/Android.mk +++ b/build/android/Android.mk @@ -47,6 +47,7 @@ LOCAL_SRC_FILES := \ offeranswer.c \ callbacks.c \ linphonecall.c \ + conference.c \ ec-calibrator.c ifndef MY_LOG_DOMAIN diff --git a/coreapi/conference.c b/coreapi/conference.c index c1058233b..695fc6121 100644 --- a/coreapi/conference.c +++ b/coreapi/conference.c @@ -157,3 +157,6 @@ int linphone_core_enter_conference(LinphoneCore *lc){ return 0; } +int linphone_core_add_all_to_conference(LinphoneCore *lc) {return 0;} +int linphone_core_terminate_conference(LinphoneCore *lc) {return 0;} +int linphone_core_get_conference_size(LinphoneCore *lc) {return 0;} diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index dbf698fad..0cd5a232c 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1025,11 +1025,14 @@ const char* linphone_call_get_authentication_token(LinphoneCall *call); bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call); int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call); +int linphone_core_add_all_to_conference(LinphoneCore *lc); int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call); bool_t linphone_core_is_in_conference(const LinphoneCore *lc); int linphone_core_enter_conference(LinphoneCore *lc); int linphone_core_leave_conference(LinphoneCore *lc); +int linphone_core_terminate_conference(LinphoneCore *lc); +int linphone_core_get_conference_size(LinphoneCore *lc); #ifdef __cplusplus } diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 7ce1959ff..d5bd4ef46 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1198,6 +1198,11 @@ extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_enableVideo(JNIEnv extern "C" jboolean Java_org_linphone_core_LinphoneCallParamsImpl_getVideoEnabled(JNIEnv *env, jobject thiz, jlong lcp){ return linphone_call_params_video_enabled((LinphoneCallParams*)lcp); } + +extern "C" jboolean Java_org_linphone_core_LinphoneCallParamsImpl_localConferenceMode(JNIEnv *env, jobject thiz, jlong lcp){ + return linphone_call_params_local_conference_mode((LinphoneCallParams*)lcp); +} + extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_destroy(JNIEnv *env, jobject thiz, jlong lc){ return linphone_call_params_destroy((LinphoneCallParams*)lc); } @@ -1323,6 +1328,41 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_pauseAllCalls(JNIEnv *en extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_resumeCall(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) { return linphone_core_resume_call((LinphoneCore *) pCore, (LinphoneCall *) pCall); } +extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInConference(JNIEnv *env,jobject thiz,jlong pCore) { + return linphone_core_is_in_conference((LinphoneCore *) pCore); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enterConference(JNIEnv *env,jobject thiz,jlong pCore) { + linphone_core_enter_conference((LinphoneCore *) pCore); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_leaveConference(JNIEnv *env,jobject thiz,jlong pCore) { + linphone_core_leave_conference((LinphoneCore *) pCore); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addAllToConference(JNIEnv *env,jobject thiz,jlong pCore) { + linphone_core_add_all_to_conference((LinphoneCore *) pCore); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addToConference(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) { + linphone_core_add_to_conference((LinphoneCore *) pCore, (LinphoneCall *) pCall); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_removeFromConference(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) { + linphone_core_remove_from_conference((LinphoneCore *) pCore, (LinphoneCall *) pCall); +} + +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateConference(JNIEnv *env,jobject thiz,jlong pCore) { + linphone_core_terminate_conference((LinphoneCore *) pCore); +} +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getConferenceSize(JNIEnv *env,jobject thiz,jlong pCore) { + return linphone_core_get_conference_size((LinphoneCore *) pCore); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateAllCalls(JNIEnv *env,jobject thiz,jlong pCore) { + linphone_core_terminate_all_calls((LinphoneCore *) pCore); +} +extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getCall(JNIEnv *env,jobject thiz,jlong pCore,jint position) { + return (jlong)ms_list_nth_data(linphone_core_get_calls((LinphoneCore *) pCore),position); +} +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getCallsNb(JNIEnv *env,jobject thiz,jlong pCore) { + return ms_list_size(linphone_core_get_calls((LinphoneCore *) pCore)); +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setZrtpSecretsCache(JNIEnv *env,jobject thiz,jlong pCore, jstring jFile) { if (jFile) { diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index a6edf1b7e..5f8745979 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -34,6 +34,14 @@ public interface LinphoneCall { @SuppressWarnings("unchecked") static private Vector values = new Vector(); private final int mValue; + public final int value() {return mValue;} + public static final int ID_INCOMING_RECEIVED=1; + public static final int ID_OUTGOING_RINGING=4; + public static final int ID_STREAMS_RUNNING=7; + public static final int ID_PAUSED=9; + public static final int ID_CALL_END=13; + public static final int ID_PAUSED_BY_REMOTE=14; + private final String mStringValue; /** * Idle @@ -42,7 +50,7 @@ public interface LinphoneCall { /** * Incoming call received. */ - public final static State IncomingReceived = new State(1,"IncomingReceived"); + public final static State IncomingReceived = new State(ID_INCOMING_RECEIVED,"IncomingReceived"); /** * Outgoing call initialiazed. */ @@ -54,7 +62,7 @@ public interface LinphoneCall { /** * Outgoing call ringing. */ - public final static State OutgoingRinging = new State(4,"OutgoingRinging"); + public final static State OutgoingRinging = new State(ID_OUTGOING_RINGING,"OutgoingRinging"); /** * Outgoing call early media */ @@ -66,7 +74,7 @@ public interface LinphoneCall { /** * Streams running */ - public final static State StreamsRunning = new State(7,"StreamsRunning"); + public final static State StreamsRunning = new State(ID_STREAMS_RUNNING,"StreamsRunning"); /** * Paussing */ @@ -74,7 +82,7 @@ public interface LinphoneCall { /** * Paused */ - public final static State Paused = new State(9,"Paused"); + public final static State Paused = new State(ID_PAUSED,"Paused"); /** * Resuming */ @@ -90,12 +98,12 @@ public interface LinphoneCall { /** * Call end */ - public final static State CallEnd = new State(13,"CallEnd"); + public final static State CallEnd = new State(ID_CALL_END,"CallEnd"); /** * Paused by remote */ - public final static State PausedByRemote = new State(14,"PausedByRemote"); + public final static State PausedByRemote = new State(ID_PAUSED_BY_REMOTE,"PausedByRemote"); /** * The call's parameters are updated, used for example when video is asked by remote @@ -219,4 +227,5 @@ public interface LinphoneCall { String getAuthenticationToken(); boolean isAuthenticationTokenVerified(); boolean areStreamsEncrypted(); + boolean isInConference(); } diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 457a7c34a..9f4e3d5a7 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -594,6 +594,20 @@ public interface LinphoneCore { boolean pauseAllCalls(); void setZrtpSecretsCache(String file); - public void enableEchoLimiter(boolean val); + void enableEchoLimiter(boolean val); + boolean isInConference(); + void enterConference(); + void leaveConference(); + + void addToConference(LinphoneCall call); + void addAllToConference(); + void removeFromConference(LinphoneCall call); + + void terminateConference(); + int getConferenceSize(); + + void terminateAllCalls(); + @SuppressWarnings("unchecked") List getCalls(); + int getCallsNb(); } diff --git a/mediastreamer2 b/mediastreamer2 index 228168085..88baea603 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 22816808514255867ae8fa5347b854f4570784f7 +Subproject commit 88baea6036b1831228cc9deff92acb944e373ce0 From fb0dfb524bfa3ae9f04ec3951b626b3cb5e7fc95 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 14 Sep 2011 11:35:50 +0200 Subject: [PATCH 5/6] Fix Android build. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 88baea603..90be72f66 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 88baea6036b1831228cc9deff92acb944e373ce0 +Subproject commit 90be72f669f3c5067c571b0f29f22eda21166006 From 26df0c6d83cee874790adc9af8e7a65841d8a46d Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 16 Sep 2011 17:17:00 +0200 Subject: [PATCH 6/6] merge patch for notification bubbles + 2nd call incoming tone notification --- configure.ac | 22 ++++++ coreapi/callbacks.c | 3 +- coreapi/linphonecore.c | 25 ++++++- coreapi/private.h | 2 + gtk/Makefile.am | 2 +- gtk/main.c | 147 ++++++++++++++++++++++++++++++++++------- gtk/main.ui | 77 ++++++++++++++++++++- mediastreamer2 | 2 +- 8 files changed, 249 insertions(+), 31 deletions(-) diff --git a/configure.ac b/configure.ac index 5fe32ef33..7c231b20a 100644 --- a/configure.ac +++ b/configure.ac @@ -145,6 +145,28 @@ else echo "GTK interface compilation is disabled." fi +AC_ARG_ENABLE(notify, + [ --enable-notify=[yes/no] Enable libnotify support [default=yes]], + [case "${enableval}" in + yes) notify=true ;; + no) notify=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-notify) ;; + esac],[notify=true]) + +dnl conditionnal build of the notify library +if test "$gtk_ui" = "true" ; then + if test "$notify" = "true"; then + PKG_CHECK_MODULES([NOTIFY], [libnotify >= 0.7.0 ], [found_notify=yes], foo=bar) + case "$found_notify" in + yes) + AC_SUBST(NOTIFY_CFLAGS) + AC_SUBST(NOTIFY_LIBS) + AC_DEFINE([HAVE_NOTIFY],[1],[NOTIFY support]) + esac + else + echo "Libnotify support is disabled." + fi +fi dnl os-specific problems not handled by existing macros. case "$host_os" in diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 1f00b1995..a49c1a968 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -195,7 +195,8 @@ static void call_received(SalOp *h){ ms_message("the local ring is already started"); } }else{ - /*TODO : play a tone within the context of the current call */ + /* play a tone within the context of the current call */ + linphone_core_play_tone(lc); } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index b042a1398..bf656c810 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2313,7 +2313,6 @@ int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call) ms_message("ring stopped"); lc->ringstream=NULL; } - linphone_core_get_default_proxy(lc,&cfg); dest_proxy=cfg; dest_proxy=linphone_core_lookup_known_proxy(lc,call->log->to); @@ -2369,6 +2368,11 @@ static void terminate_call(LinphoneCore *lc, LinphoneCall *call){ ring_stop(lc->ringstream); lc->ringstream=NULL; } + + /*stop any dtmf tone still playing */ + ms_message("test"); + linphone_core_stop_dtmf(lc); + linphone_call_stop_media_streams(call); if (lc->vtable.display_status!=NULL) lc->vtable.display_status(lc,_("Call ended") ); @@ -3684,6 +3688,25 @@ void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms){ else ms_filter_call_method(f, MS_DTMF_GEN_START, &dtmf); } +/** + * @ingroup media_parameters + * Plays a repeated tone to the local user until next further call to #linphone_core_stop_dtmf() + * @param lc #LinphoneCore +**/ +void linphone_core_play_tone(LinphoneCore *lc){ + MSFilter *f=get_dtmf_gen(lc); + MSDtmfGenCustomTone def; + if (f==NULL){ + ms_error("No dtmf generator at this time !"); + return; + } + def.duration=300; + def.frequency=500; + def.amplitude=1; + def.interval=800; + ms_filter_call_method(f, MS_DTMF_GEN_PLAY_CUSTOM,&def); +} + /** * @ingroup media_parameters * diff --git a/coreapi/private.h b/coreapi/private.h index bb1fb883b..47592514f 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -210,6 +210,8 @@ int linphone_proxy_config_normalize_number(LinphoneProxyConfig *cfg, const char void linphone_core_text_received(LinphoneCore *lc, const char *from, const char *msg); +void linphone_core_play_tone(LinphoneCore *lc); + void linphone_call_init_media_streams(LinphoneCall *call); void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_muted, bool_t send_ringbacktone); void linphone_call_stop_media_streams(LinphoneCall *call); diff --git a/gtk/Makefile.am b/gtk/Makefile.am index c51234eb3..56ac4a336 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -49,7 +49,7 @@ linphone_SOURCES= \ linphone_LDADD=$(ORTP_LIBS) \ $(MEDIASTREAMER_LIBS) \ $(top_builddir)/coreapi/liblinphone.la \ - $(LIBGTK_LIBS) $(LIBGTKMAC_LIBS) $(INTLLIBS) + $(LIBGTK_LIBS) $(NOTIFY_LIBS) $(LIBGTKMAC_LIBS) $(INTLLIBS) if BUILD_WIN32 diff --git a/gtk/main.c b/gtk/main.c index e8313628f..ac4e632aa 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -36,6 +36,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define chdir _chdir #endif +#ifdef HAVE_NOTIFY +#include +#endif + #define LINPHONE_ICON "linphone.png" const char *this_program_ident_string="linphone_ident_string=" LINPHONE_VERSION; @@ -56,6 +60,7 @@ static void linphone_gtk_call_log_updated(LinphoneCore *lc, LinphoneCallLog *cl) static void linphone_gtk_refer_received(LinphoneCore *lc, const char *refer_to); static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cs, const char *msg); static gboolean linphone_gtk_auto_answer(LinphoneCall *call); +static void linphone_gtk_status_icon_set_blinking(gboolean val); static gboolean verbose=0; @@ -622,6 +627,24 @@ static void completion_add_text(GtkEntry *entry, const char *text){ save_uri_history(); } + +static void linphone_gtk_show_main_window(){ + GtkWidget *w=linphone_gtk_get_main_window(); + LinphoneCore *lc=linphone_gtk_get_core(); + if (linphone_core_video_enabled(lc)){ + linphone_core_enable_video_preview(lc,linphone_gtk_get_ui_config_int("videoselfview", + VIDEOSELFVIEW_DEFAULT)); + } + gtk_widget_show(w); + gtk_window_present(GTK_WINDOW(w)); +} + +static void linphone_gtk_show(LinphoneCore *lc){ +#ifndef HAVE_NOTIFY + linphone_gtk_show_main_window(); +#endif +} + void linphone_gtk_call_terminated(LinphoneCall *call, const char *error){ GtkWidget *mw=linphone_gtk_get_main_window(); if (linphone_core_get_calls(linphone_gtk_get_core())==NULL){ @@ -749,6 +772,7 @@ void linphone_gtk_answer_clicked(GtkWidget *button){ if (call){ linphone_core_pause_all_calls(linphone_gtk_get_core()); linphone_core_accept_call(linphone_gtk_get_core(),call); + linphone_gtk_show_main_window(); /* useful when the button is clicked on a notification */ } } @@ -759,7 +783,7 @@ void linphone_gtk_enable_video(GtkWidget *w){ gtk_widget_set_sensitive(selfview_item,val); if (val){ linphone_core_enable_video_preview(linphone_gtk_get_core(), - linphone_gtk_get_ui_config_int("videoselfview",VIDEOSELFVIEW_DEFAULT)); + linphone_gtk_get_ui_config_int("videoselfview",VIDEOSELFVIEW_DEFAULT)); }else{ linphone_core_enable_video_preview(linphone_gtk_get_core(),FALSE); } @@ -783,21 +807,6 @@ void linphone_gtk_used_identity_changed(GtkWidget *w){ if (sel) g_free(sel); } -static void linphone_gtk_show_main_window(){ - GtkWidget *w=linphone_gtk_get_main_window(); - LinphoneCore *lc=linphone_gtk_get_core(); - if (linphone_core_video_enabled(lc)){ - linphone_core_enable_video_preview(lc,linphone_gtk_get_ui_config_int("videoselfview", - VIDEOSELFVIEW_DEFAULT)); - } - gtk_widget_show(w); - gtk_window_present(GTK_WINDOW(w)); -} - -static void linphone_gtk_show(LinphoneCore *lc){ - linphone_gtk_show_main_window(); -} - static void linphone_gtk_notify_recv(LinphoneCore *lc, LinphoneFriend * fid){ linphone_gtk_show_friends(); } @@ -938,6 +947,54 @@ static void linphone_gtk_call_log_updated(LinphoneCore *lc, LinphoneCallLog *cl) if (w) linphone_gtk_call_log_update(w); } +#ifdef HAVE_NOTIFY +static void make_notification(const char *title, const char *body){ + NotifyNotification *n; + n = notify_notification_new(title,body,linphone_gtk_get_ui_config("icon",LINPHONE_ICON)); + if (n && !notify_notification_show(n,NULL)) + ms_error("Failed to send notification."); +} + +#endif + +static void linphone_gtk_notify(LinphoneCall *call, const char *msg){ +#ifdef HAVE_NOTIFY + if (!notify_is_initted()) + if (!notify_init ("Linphone")) ms_error("Libnotify failed to init."); +#endif + if (!call) { +#ifdef HAVE_NOTIFY + if (!notify_notification_show(notify_notification_new("Linphone",msg,NULL),NULL)) + ms_error("Failed to send notification."); +#else + linphone_gtk_show_main_window(); +#endif + } else if (!gtk_window_is_active((GtkWindow*)linphone_gtk_get_main_window())) { +#ifdef HAVE_NOTIFY + char *body=NULL; + char *remote=call!=NULL ? linphone_call_get_remote_address_as_string(call) : NULL; + switch(linphone_call_get_state(call)){ + case LinphoneCallError: + make_notification(_("Call error"),body=g_markup_printf_escaped("%s\n%s",msg,remote)); + break; + case LinphoneCallEnd: + make_notification(_("Call ended"),body=g_markup_printf_escaped("%s",remote)); + break; + case LinphoneCallIncomingReceived: + make_notification(_("Incoming call"),body=g_markup_printf_escaped("%s",remote)); + break; + case LinphoneCallPausedByRemote: + make_notification(_("Call paused"),body=g_markup_printf_escaped("by %s",remote)); + break; + default: + break; + } + if (body) g_free(body); + if (remote) g_free(remote); +#endif + } +} + static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cs, const char *msg){ switch(cs){ case LinphoneCallOutgoingInit: @@ -954,10 +1011,12 @@ static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call break; case LinphoneCallEnd: linphone_gtk_in_call_view_terminate(call,NULL); + linphone_gtk_status_icon_set_blinking(FALSE); break; case LinphoneCallIncomingReceived: linphone_gtk_create_in_call_view (call); linphone_gtk_in_call_view_set_incoming(call,!all_other_calls_paused (call,linphone_core_get_calls(lc))); + linphone_gtk_status_icon_set_blinking(TRUE); if (auto_answer) { linphone_call_ref(call); g_timeout_add(2000,(GSourceFunc)linphone_gtk_auto_answer ,call); @@ -974,10 +1033,12 @@ static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call break; case LinphoneCallConnected: linphone_gtk_enable_hold_button (call,TRUE,TRUE); + linphone_gtk_status_icon_set_blinking(FALSE); break; default: break; } + linphone_gtk_notify(call, msg); linphone_gtk_update_call_buttons (call); } @@ -1060,18 +1121,49 @@ static GtkStatusIcon *icon=NULL; static void linphone_gtk_init_status_icon(){ const char *icon_path=linphone_gtk_get_ui_config("icon",LINPHONE_ICON); + const char *call_icon_path=linphone_gtk_get_ui_config("start_call_icon","startcall-green.png"); GdkPixbuf *pbuf=create_pixbuf(icon_path); GtkWidget *menu=create_icon_menu(); const char *title; + title=linphone_gtk_get_ui_config("title",_("Linphone - a video internet phone")); icon=gtk_status_icon_new_from_pixbuf(pbuf); - g_object_unref(G_OBJECT(pbuf)); + gtk_status_icon_set_name(icon,title); g_signal_connect_swapped(G_OBJECT(icon),"activate",(GCallback)linphone_gtk_show_main_window,linphone_gtk_get_main_window()); g_signal_connect(G_OBJECT(icon),"popup-menu",(GCallback)icon_popup_menu,NULL); - title=linphone_gtk_get_ui_config("title",_("Linphone - a video internet phone")); gtk_status_icon_set_tooltip(icon,title); gtk_status_icon_set_visible(icon,TRUE); g_object_set_data(G_OBJECT(icon),"menu",menu); g_object_weak_ref(G_OBJECT(icon),(GWeakNotify)gtk_widget_destroy,menu); + g_object_set_data(G_OBJECT(icon),"icon",pbuf); + g_object_weak_ref(G_OBJECT(icon),(GWeakNotify)g_object_unref,pbuf); + pbuf=create_pixbuf(call_icon_path); + g_object_set_data(G_OBJECT(icon),"call_icon",pbuf); +} + +static gboolean do_icon_blink(GtkStatusIcon *gi){ + GdkPixbuf *call_icon=g_object_get_data(G_OBJECT(gi),"call_icon"); + GdkPixbuf *normal_icon=g_object_get_data(G_OBJECT(gi),"icon"); + GdkPixbuf *cur_icon=gtk_status_icon_get_pixbuf(gi); + if (cur_icon==call_icon){ + gtk_status_icon_set_from_pixbuf(gi,normal_icon); + }else{ + gtk_status_icon_set_from_pixbuf(gi,call_icon); + } + return TRUE; +} + +static void linphone_gtk_status_icon_set_blinking(gboolean val){ + guint tout; + tout=(unsigned)GPOINTER_TO_INT(g_object_get_data(G_OBJECT(icon),"timeout")); + if (val && tout==0){ + tout=g_timeout_add(1000,(GSourceFunc)do_icon_blink,icon); + g_object_set_data(G_OBJECT(icon),"timeout",GINT_TO_POINTER(tout)); + }else if (!val && tout!=0){ + GdkPixbuf *normal_icon=g_object_get_data(G_OBJECT(icon),"icon"); + g_source_remove(tout); + g_object_set_data(G_OBJECT(icon),"timeout",NULL); + gtk_status_icon_set_from_pixbuf(icon,normal_icon); + } } void linphone_gtk_load_identities(void){ @@ -1348,9 +1440,11 @@ void linphone_gtk_log_handler(OrtpLogLevel lev, const char *fmt, va_list args){ static void linphone_gtk_refer_received(LinphoneCore *lc, const char *refer_to){ - GtkEntry * uri_bar =GTK_ENTRY(linphone_gtk_get_widget( + GtkEntry * uri_bar =GTK_ENTRY(linphone_gtk_get_widget( linphone_gtk_get_main_window(), "uribar")); - linphone_gtk_show_main_window(); + char *text; + linphone_gtk_notify(NULL,(text=ms_strdup_printf(_("We are transferred to %s"),refer_to))); + g_free(text); gtk_entry_set_text(uri_bar, refer_to); linphone_gtk_start_call(linphone_gtk_get_main_window()); } @@ -1359,16 +1453,19 @@ static void linphone_gtk_check_soundcards(){ const char **devices=linphone_core_get_sound_devices(linphone_gtk_get_core()); if (devices==NULL || devices[0]==NULL){ linphone_gtk_display_something(GTK_MESSAGE_WARNING, - _("No sound cards have been detected on this computer.\n" - "You won't be able to send or receive audio calls.")); + _("No sound cards have been detected on this computer.\n" + "You won't be able to send or receive audio calls.")); } } static void linphone_gtk_quit(void){ gdk_threads_leave(); - linphone_gtk_destroy_log_window(); - linphone_core_destroy(the_core); - linphone_gtk_log_uninit(); + linphone_gtk_destroy_log_window(); + linphone_core_destroy(the_core); + linphone_gtk_log_uninit(); +#ifdef HAVE_NOTIFY + notify_uninit(); +#endif } #ifdef HAVE_GTK_OSX diff --git a/gtk/main.ui b/gtk/main.ui index ea9c596b0..7a57073ac 100644 --- a/gtk/main.ui +++ b/gtk/main.ui @@ -2,6 +2,66 @@ + + False + + + True + False + 0 + none + + + True + False + 12 + + + True + False + + + True + False + + + True + True + 0 + + + + + + + + True + True + True + False + + + + True + True + 2 + + + + + + + + + True + False + <b>Callee name</b> + True + + + + + False @@ -90,7 +150,6 @@ True False - spread Mute @@ -106,6 +165,20 @@ 0 + + + Merge to conference + True + True + False + + + + True + True + 1 + + Pause @@ -118,7 +191,7 @@ False False - 1 + 2 diff --git a/mediastreamer2 b/mediastreamer2 index 90be72f66..a73e55293 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 90be72f669f3c5067c571b0f29f22eda21166006 +Subproject commit a73e55293ed2b551cf12bfc85d812fa659fb25da