Пример #1
0
void linphone_gtk_remove_in_call_view(LinphoneCall *call) {
    GtkWidget *w=(GtkWidget*)linphone_call_get_user_pointer (call);
    GtkWidget *main_window=linphone_gtk_get_main_window ();
    GtkWidget *nb=linphone_gtk_get_widget(main_window,"viewswitch");
    gboolean in_conf=linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call));
    int idx;
    g_return_if_fail(w!=NULL);
    idx=gtk_notebook_page_num(GTK_NOTEBOOK(nb),w);
    if (in_conf) {
        linphone_gtk_unset_from_conference(call);
    }
    linphone_call_set_user_pointer (call,NULL);
    linphone_call_unref(call);
    call=linphone_core_get_current_call(linphone_gtk_get_core());
    if (call==NULL) {
        if (linphone_core_is_in_conference(linphone_gtk_get_core())) {
            /*show the conference*/
            gtk_notebook_set_current_page(GTK_NOTEBOOK(nb),gtk_notebook_page_num(GTK_NOTEBOOK(nb),
                                          g_object_get_data(G_OBJECT(main_window),"conf_frame")));
        } else gtk_notebook_prev_page(GTK_NOTEBOOK(nb));
    } else {
        /*show the active call*/
        gtk_notebook_set_current_page(GTK_NOTEBOOK(nb),gtk_notebook_page_num(GTK_NOTEBOOK(nb),                                                                     linphone_call_get_user_pointer(call)));
    }
    gtk_notebook_remove_page (GTK_NOTEBOOK(nb),idx);
    gtk_widget_destroy(w);
}
Пример #2
0
static int remove_from_conference(LinphoneCore *lc, LinphoneCall *call, bool_t active){
	int err=0;

	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;

	char *str=linphone_call_get_remote_address_as_string(call);
	ms_message("%s will be removed from conference", str);
	ms_free(str);
	if (active){
		LinphoneCallParams *params=linphone_call_params_copy(linphone_call_get_current_params(call));
		params->in_conference=FALSE;
		// reconnect local audio with this call
		if (linphone_core_is_in_conference(lc)){
			ms_message("Leaving conference for reconnecting with unique call.");
			linphone_core_leave_conference(lc);
		}
		ms_message("Updating call to actually remove from conference");
		err=linphone_core_update_call(lc,call,params);
		linphone_call_params_destroy(params);
	} else{
		ms_message("Pausing call to actually remove from conference");
		err=_linphone_core_pause_call(lc,call);
	}

	return err;
}
Пример #3
0
static int convert_conference_to_call(LinphoneCore *lc){
	int err=0;
	MSList *calls=lc->calls;

	if (remote_participants_count(&lc->conf_ctx)!=1){
		ms_error("No unique call remaining in conference.");
		return -1;
	}

	while (calls) {
		LinphoneCall *rc=(LinphoneCall*)calls->data;
		calls=calls->next;
		if (rc->params.in_conference) { // not using current_param
			bool_t active_after_removed=linphone_core_is_in_conference(lc);
			err=remove_from_conference(lc, rc, active_after_removed);
			break;
		}
	}
	return err;
}
Пример #4
0
/**
 * Moves the local participant out of the conference.
 * @param lc the linphone core
 * When the local participant is out of the conference, the remote participants can continue to talk normally.
 * @returns 0 if successful, -1 otherwise.
**/
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;
}