Example #1
0
bool_t linphone_gtk_init_instance(const char *app_name, const char *addr_to_call){
	pipe_name=make_name(app_name);
	ortp_pipe_t p=ortp_client_pipe_connect(pipe_name);
	if (p!=(ortp_pipe_t)-1){
		uint8_t buf[256]={0};
		g_message("There is already a running instance.");
		if (addr_to_call!=NULL){
			//strncpy((char*)buf,addr_to_call,sizeof(buf)-1);
			sprintf((char*)buf, "%s %s %s", addr_to_call, aupkg_file, (g_enable_video==FALSE)?"audio":"video");
		}
		if (ortp_pipe_write(p,buf,sizeof(buf))==-1){
			g_error("Fail to send wakeup command to running instance: %s",strerror(errno));
		}else{
			g_message("Message to running instance sent.");
		}
		ortp_client_pipe_close(p);
		return FALSE;
	}else{
		linphone_gtk_init_pipe(pipe_name);
	}
	return TRUE;
}
Example #2
0
bool_t linphone_gtk_init_instance(const char *app_name, int option, const char *addr_to_call){
	ortp_pipe_t p;
	pipe_name=make_name(app_name);
	p=ortp_client_pipe_connect(pipe_name);
	if (p!=(ortp_pipe_t)-1){
		uint8_t buf[256]={0};
		g_message("There is already a running instance.");
		if (addr_to_call!=NULL){
			sprintf((char *)buf,"%i%s",option,addr_to_call);
		} else {
			sprintf((char *)buf,"%i",option);
		}
		if (ortp_pipe_write(p,buf,sizeof(buf))==-1){
			g_error("Fail to send wakeup command to running instance: %s",strerror(errno));
		}else{
			g_message("Message to running instance sent.");
		}
		ortp_client_pipe_close(p);
		return FALSE;
	}else{
		linphone_gtk_init_pipe(pipe_name);
	}
	return TRUE;
}