]> sjero.net Git - linphone/commitdiff
Handle conference and on hold music.
authorGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Thu, 1 Dec 2011 14:48:22 +0000 (15:48 +0100)
committerGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Thu, 1 Dec 2011 14:48:22 +0000 (15:48 +0100)
When hosting a conference, mute conference participant when he
pauses us to prevent his holding music to be played to all participants.

When resuming a call, stop immediately sending the hold music,
even before receiving the 200OK. When the paused call is a conference,
it prevents the conference participants to hear the hold music while
the 200OK is back.

coreapi/conference.c
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/private.h
mediastreamer2

index 7efed4f2d9116f20db5d8918ae57e21b6ff2f390..288ab2b46ca1a9cc5e6e9d7ad46064a0b41666e3 100644 (file)
@@ -60,8 +60,7 @@ void linphone_core_conference_check_uninit(LinphoneConference *ctx){
        }
 }
 
-
-void linphone_call_add_to_conf(LinphoneCall *call){
+void linphone_call_add_to_conf(LinphoneCall *call, bool_t muted){
        LinphoneCore *lc=call->core;
        LinphoneConference *conf=&lc->conf_ctx;
        MSAudioEndpoint *ep;
@@ -69,6 +68,7 @@ void linphone_call_add_to_conf(LinphoneCall *call){
        call->camera_active = FALSE;
        ep=ms_audio_endpoint_get_from_stream(call->audiostream,TRUE);
        ms_audio_conference_add_member(conf->conf,ep);
+       ms_audio_conference_mute_member(conf->conf,ep,muted);
        call->endpoint=ep;
 }
 
index 84b4b1232950f81068f75b4d51f7053d1a806612..712d980626f8e3ae46613e760179504da4ceb757 100644 (file)
@@ -1140,7 +1140,8 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
                        }else call->audiostream_encrypted=FALSE;
                        if (call->params.in_conference){
                                /*transform the graph to connect it to the conference filter */
-                               linphone_call_add_to_conf(call);
+                               bool_t mute=stream->dir==SalStreamRecvOnly;
+                               linphone_call_add_to_conf(call, mute);
                        }
                        call->current_params.in_conference=call->params.in_conference;
                }else ms_warning("No audio stream accepted ?");
index cf827dd258bfd749538e9874f726505b96b2a328..6bd1b6e9b0259766ebf45b5d15bc112bb3615f09 100644 (file)
@@ -2581,6 +2581,11 @@ int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *the_call)
                linphone_core_preempt_sound_resources(lc);
                ms_message("Resuming call %p",call);
        }
+
+       // Stop playing music immediately. If remote side is a conference it
+       // prevents the participants to hear it while the 200OK comes back.
+       audio_stream_play(call->audiostream, NULL);
+
        update_local_media_description(lc,the_call,&call->localdesc);
        sal_call_set_local_media_description(call->op,call->localdesc);
        sal_media_description_set_dir(call->localdesc,SalStreamSendRecv);
index 6853906895636a4a24d8bf5f8c4a983f157b2731..93b1f459f4f8e43be15c380984781de2934d149f 100644 (file)
@@ -520,7 +520,11 @@ void linphone_call_background_tasks(LinphoneCall *call, bool_t one_second_elapse
 void linphone_core_preempt_sound_resources(LinphoneCore *lc);
 /*conferencing subsystem*/
 void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t muted);
-void linphone_call_add_to_conf(LinphoneCall *call);
+/* When a conference participant pause the conference he may send a music.
+ * We don't want to hear that music or to send it to the other participants.
+ * Use muted=yes to handle this case.
+ */
+void linphone_call_add_to_conf(LinphoneCall *call, bool_t muted);
 void linphone_call_remove_from_conf(LinphoneCall *call);
 void linphone_core_conference_check_uninit(LinphoneConference *ctx);
 bool_t linphone_core_sound_resources_available(LinphoneCore *lc);
index f27d83cdfd08bd590d73a3e6f632a6237acbf0e7..c53138bdb19b50f7357d0bee621de0a7be9bd601 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f27d83cdfd08bd590d73a3e6f632a6237acbf0e7
+Subproject commit c53138bdb19b50f7357d0bee621de0a7be9bd601