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);
static void linphonec_codec_disable(int type, LinphoneCore *lc, int index);
-
/* Command table management */
static LPC_COMMAND *lpc_find_command(const char *name);
"'transfer <call id> <sip-uri>': transfers the call with 'id' to the destination sip-uri\n"
"'transfer <call id1> --to-call <call id2>': 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 <call id> : join the call with id 'call id' into the audio conference."
+ "'conference rm <call id> : 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
}
+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
}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);
}
}
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.
}
}
}
- 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);
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);
}
}
}
- 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);
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){
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);
-Subproject commit a8ca8f204ca57d18f6e1c0515adaf7edb0c905dd
+Subproject commit 22816808514255867ae8fa5347b854f4570784f7