Пример #1
0
/**
 * Merge a call into a conference.
 * @param lc the linphone core
 * @param call an established call, either in LinphoneCallStreamsRunning or LinphoneCallPaused state.
 * 
 * If this is the first call that enters the conference, the virtual conference will be created automatically.
 * If the local user was actively part of the call (ie not in paused state), then the local user is automatically entered into the conference.
 * If the call was in paused state, then it is automatically resumed when entering into the conference.
 * 
 * @returns 0 if successful, -1 otherwise.
**/
int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call){
	LinphoneConference *conf=&lc->conf_ctx;
	
	if (call->current_params.in_conference){
		ms_error("Already in conference");
		return -1;
	}
	conference_check_init(&lc->conf_ctx, lp_config_get_int(lc->config, "sound","conference_rate",16000));
	
	if (call->state==LinphoneCallPaused){
		call->params.in_conference=TRUE;
		call->params.has_video=FALSE;
		linphone_core_resume_call(lc,call);
	}else if (call->state==LinphoneCallStreamsRunning){
		LinphoneCallParams *params=linphone_call_params_copy(linphone_call_get_current_params(call));
		params->in_conference=TRUE;
		params->has_video=FALSE;
		
		if (call->audiostream || call->videostream){
			linphone_call_stop_media_streams (call); /*free the audio & video local resources*/
		}
		if (call==lc->current_call){
			lc->current_call=NULL;
		}
		/*this will trigger a reINVITE that will later redraw the streams */
		linphone_core_update_call(lc,call,params);
		linphone_call_params_destroy(params);
		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;
	}
	return 0;
}
Пример #2
0
/**
 * Moves the local participant inside the conference.
 * @param lc the linphone core
 * 
 * Makes the local participant to join the conference. 
 * Typically, the local participant is by default always part of the conference when joining an active call into a conference.
 * However, by calling linphone_core_leave_conference() and linphone_core_enter_conference() the application can decide to temporarily
 * move out and in the local participant from the conference.
 * 
 * @returns 0 if successful, -1 otherwise
**/
int linphone_core_enter_conference(LinphoneCore *lc){
	if (linphone_core_sound_resources_locked(lc)) {
		return -1;
	}
	if (lc->current_call != NULL) {
		_linphone_core_pause_call(lc, lc->current_call);
	}
	LinphoneConference *conf=&lc->conf_ctx;
	if (conf->local_participant==NULL) add_local_endpoint(conf,lc);
	return 0;
}
Пример #3
0
CORBA::ULong
TAO_IIOP_Endpoint::preferred_interfaces (const char *csv,
                                         bool enforce,
                                         TAO_IIOP_Profile &profile)
{
  ACE_Vector<ACE_CString> preferred;
  find_preferred_interfaces(this->host_.in(), csv, preferred);
  CORBA::ULong count = static_cast<CORBA::ULong> (preferred.size());
  size_t i = 0;
  while (i < count && ACE_OS::strstr (preferred[i].c_str(), "if=") != 0)
    {
      // For now we disregard these with IIOP
      ++i;
    }
  if (i < count)
  {
    this->is_encodable_ = true;
    this->preferred_path_.host = CORBA::string_dup(preferred[i].c_str());
    TAO_IIOP_Endpoint* ep = this;
    for (++i; i < count; ++i)
    {
      if (ACE_OS::strstr (preferred[i].c_str(), "if=") == 0)
        ep = add_local_endpoint (ep, preferred[i].c_str(), profile);
    }

    // If we're not enforcing the preferred interfaces, then we can just add
    // a new non-preferred endpoint to the end with a default local addr.
    if (! enforce)
    {
      ep = add_local_endpoint (ep, "", profile);
    }
    else
    {
      --count;
    }
  }
  return count;
}