bool
local_roster_bridge_init (Ekiga::ServiceCore &core,
			  int * /*argc*/,
			  char ** /*argv*/[])
{
  bool result = false;
  Ekiga::ContactCore *contact_core = NULL;
  Local::Cluster *cluster = NULL;
  Local::ContactDecorator *decorator = NULL;

  contact_core
    = dynamic_cast<Ekiga::ContactCore*>(core.get ("contact-core"));

  cluster
    = dynamic_cast<Local::Cluster*>(core.get ("local-cluster"));

  if (cluster != NULL && contact_core != NULL) {

    decorator = new Local::ContactDecorator (*cluster);
    core.add (*decorator);
    contact_core->add_contact_decorator (*decorator);
    result = true;
  }

  return result;
}
Esempio n. 2
0
  bool try_initialize_more (Ekiga::ServiceCore& core,
			    int* /*argc*/,
			    char** /*argv*/[])
  {
    gmref_ptr<Ekiga::ContactCore> contact_core = core.get ("contact-core");
    gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core");
    gmref_ptr<Ekiga::CallCore> call_core = core.get ("call-core");
    gmref_ptr<Ekiga::ChatCore> chat_core = core.get ("chat-core");
    gmref_ptr<Ekiga::AccountCore> account_core = core.get ("account-core");

    if (contact_core && presence_core && call_core && chat_core && account_core) {

      gmref_ptr<CallManager> call_manager (new CallManager (core));

      gmref_ptr<Opal::Bank> bank (new Bank (core));

      account_core->add_bank (bank);
      core.add (bank);
      call_manager->ready.connect (sigc::mem_fun (&*bank, &Opal::Bank::call_manager_ready));

      unsigned sip_port = gm_conf_get_int (SIP_KEY "listen_port");
      gmref_ptr<Sip::EndPoint> sip_manager (new Sip::EndPoint (*call_manager, core, sip_port));
      call_manager->add_protocol_manager (sip_manager);
      account_core->add_account_subscriber (*sip_manager);
      contact_core->add_contact_decorator (sip_manager);
      presence_core->add_presentity_decorator (sip_manager);
      presence_core->add_presence_fetcher (sip_manager);
      presence_core->add_presence_publisher (sip_manager);

#ifdef HAVE_H323
      unsigned h323_port = gm_conf_get_int (H323_KEY "listen_port");
      gmref_ptr<H323::EndPoint> h323_manager (new H323::EndPoint (*call_manager, core, h323_port));
      call_manager->add_protocol_manager (h323_manager);
      account_core->add_account_subscriber (*h323_manager);
      contact_core->add_contact_decorator (h323_manager);
      presence_core->add_presentity_decorator (h323_manager);
#endif

      call_core->add_manager (call_manager);

      core.add (call_manager);

      new ConfBridge (*call_manager); // FIXME: isn't that leaked!?

      presence_core->add_supported_uri (sigc::ptr_fun (is_supported_address)); //FIXME

      OpalLinkerHacks::loadOpalVideoInput = 1;
      OpalLinkerHacks::loadOpalVideoOutput = 1;
      OpalLinkerHacks::loadOpalAudio = 1;

      result = true;
    }

    return result;
  }
GMAudioOutputManager_null::GMAudioOutputManager_null (Ekiga::ServiceCore & _core)
: core (_core),
  runtime (*(dynamic_cast<Ekiga::Runtime *> (_core.get ("runtime"))))
{
  current_state[Ekiga::primary].opened = false;
  current_state[Ekiga::secondary].opened = false;
}
Esempio n. 4
0
  bool try_initialize_more (Ekiga::ServiceCore& core,
			    int* /*argc*/,
			    char** /*argv*/[])
  {
    gmref_ptr<Ekiga::Service> service = core.get ("call-history-store");
    gmref_ptr<Ekiga::ContactCore> contact_core = core.get ("contact-core");
    gmref_ptr<Ekiga::CallCore> call_core = core.get ("call-core");

    if (contact_core && call_core && !service) {

      gmref_ptr<History::Source> source (new History::Source (core));
      core.add (source);
      contact_core->add_source (source);
      result = true;
    }

    return result;
  }
Esempio n. 5
0
/* The Methods */
PVideoOutputDevice_EKIGA::PVideoOutputDevice_EKIGA (Ekiga::ServiceCore & _core)
: core (_core), videooutput_core (*(dynamic_cast<Ekiga::VideoOutputCore *> (_core.get ("videooutput-core"))))
{ 
 PWaitAndSignal m(videoDisplay_mutex);

  is_active = FALSE;
  
  /* Used to distinguish between input and output device. */
  device_id = 0; 
}
Esempio n. 6
0
  bool try_initialize_more (Ekiga::ServiceCore& core,
			    int* /*argc*/,
			    char** /*argv*/[])
  {
    boost::shared_ptr<Ekiga::ContactCore> contact_core = core.get<Ekiga::ContactCore> ("contact-core");
    boost::shared_ptr<Ekiga::PresenceCore> presence_core = core.get<Ekiga::PresenceCore> ("presence-core");
    boost::shared_ptr<Ekiga::CallCore> call_core = core.get<Ekiga::CallCore> ("call-core");
    boost::shared_ptr<Ekiga::ChatCore> chat_core = core.get<Ekiga::ChatCore> ("chat-core");
    boost::shared_ptr<Ekiga::AccountCore> account_core = core.get<Ekiga::AccountCore> ("account-core");
    boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core = core.get<Ekiga::AudioInputCore> ("audioinput-core");
    boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core = core.get<Ekiga::VideoInputCore> ("videoinput-core");
    boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core = core.get<Ekiga::AudioOutputCore> ("audiooutput-core");
    boost::shared_ptr<Ekiga::VideoOutputCore> videooutput_core = core.get<Ekiga::VideoOutputCore> ("videooutput-core");
    boost::shared_ptr<Ekiga::PersonalDetails> personal_details = core.get<Ekiga::PersonalDetails> ("personal-details");
    boost::shared_ptr<Bank> account_store = core.get<Bank> ("opal-account-store");
    Ekiga::ServicePtr sip_endpoint = core.get ("opal-sip-endpoint");

    if (contact_core && presence_core && call_core && chat_core
	&& account_core && audioinput_core && videoinput_core
	&& audiooutput_core && videooutput_core && personal_details
	&& !account_store && !sip_endpoint) {

      PIPSocket::SetSuppressCanonicalName (true);  // avoid long delays

      hook_ekiga_plugins_to_opal (core);

      boost::shared_ptr<CallManager> call_manager (new CallManager (core));
      core.add (call_manager);

      boost::shared_ptr<Sip::EndPoint> sip_manager (new Sip::EndPoint (*call_manager, core), null_deleter ());
      std::cout << "FIXME: where is H323" << std::endl << std::flush;
      sip_manager->setup ();
      call_manager->set_sip_endpoint (sip_manager);
      core.add (sip_manager);

      boost::shared_ptr<Bank> bank (new Bank (core));
      account_core->add_bank (bank);
      presence_core->add_cluster (bank);
      core.add (bank);
      contact_core->add_contact_decorator (bank);
      presence_core->add_presentity_decorator (bank);
      call_manager->ready.connect (boost::bind (&Opal::Bank::call_manager_ready, &*bank));
      call_manager->setup ();
      presence_core->add_presence_publisher (bank);
      presence_core->add_presence_fetcher (bank);

      call_core->add_manager (call_manager);

      presence_core->add_supported_uri (&is_supported_address); //FIXME

      result = true;
    }

    return result;
  }
Esempio n. 7
0
  bool try_initialize_more (Ekiga::ServiceCore& core,
			    int* /*argc*/,
			    char** /*argv*/[])
  {
    Ekiga::ServicePtr service = core.get ("xcap-core");

    if ( !service) {

      boost::shared_ptr<XCAP::Core> xcap(new XCAP::Core ());

      core.add (xcap);
      result = true;
    }

    return result;
  }
Esempio n. 8
0
/* The class */
Opal::Sip::EndPoint::EndPoint (Opal::CallManager & _manager, 
                               Ekiga::ServiceCore & _core, 
                               unsigned _listen_port)
:   SIPEndPoint (_manager),
    manager (_manager), 
    core (_core),
    presence_core (*(dynamic_cast<Ekiga::PresenceCore *> (core.get ("presence-core")))),
    runtime (*(dynamic_cast<Ekiga::Runtime *> (core.get ("runtime")))),
    account_core (*(dynamic_cast<Ekiga::AccountCore *> (core.get ("account-core"))))
{
  Ekiga::ChatCore* chat_core;

  protocol_name = "sip";
  uri_prefix = "sip:";
  listen_port = _listen_port;

  chat_core = dynamic_cast<Ekiga::ChatCore *> (core.get ("chat-core"));
  dialect = new SIP::Dialect (core, sigc::mem_fun (this, &Opal::Sip::EndPoint::send_message));
  chat_core->add_dialect (*dialect);

  /* Timeouts */
  SetAckTimeout (PTimeInterval (0, 32));
  SetPduCleanUpTimeout (PTimeInterval (0, 1));
  SetInviteTimeout (PTimeInterval (0, 6));
  SetNonInviteTimeout (PTimeInterval (0, 6));
  SetRetryTimeouts (500, 4000);
  SetMaxRetries (8);

  /* Start listener */
  set_listen_port (listen_port);

  /* Update the User Agent */
  SetUserAgent ("Ekiga/" PACKAGE_VERSION);

  /* Ready to take calls */
  manager.AddRouteEntry("sip:.* = pc:<db>");
  manager.AddRouteEntry("pc:.* = sip:<da>");

  /* NAT Binding */
  SetNATBindingRefreshMethod (SIPEndPoint::EmptyRequest);

  Ekiga::PersonalDetails *details = dynamic_cast<Ekiga::PersonalDetails *> (_core.get ("personal-details"));
  if (details)
    publish (*details);
}
Esempio n. 9
0
  bool try_initialize_more (Ekiga::ServiceCore& core,
			    int* /*argc*/,
			    char** /*argv*/[])
  {
    gmref_ptr<Ekiga::HalCore> hal_core = core.get ("hal-core");

    if (hal_core) {

      HalManager_dbus *hal_manager = new HalManager_dbus(core);

      hal_core->add_manager (*hal_manager);
      core.add (gmref_ptr<Ekiga::Service> (new Ekiga::BasicService ("hal-dbus",
								    "\tComponent bringing HAL through DBUS")));
      result = true;
    }

    return result;
  }
Esempio n. 10
0
  bool try_initialize_more (Ekiga::ServiceCore& core,
			    int* /*argc*/,
			    char** /*argv*/[])
  {
    Ekiga::ServicePtr service = core.get ("resource-list");
    boost::shared_ptr<Ekiga::PresenceCore> presence_core = core.get<Ekiga::PresenceCore> ("presence-core");
    boost::shared_ptr<XCAP::Core> xcap = core.get<XCAP::Core> ("xcap-core");

    if ( !service && presence_core && xcap) {

      boost::shared_ptr<RL::Cluster> cluster (new RL::Cluster (core));
      core.add (cluster);
      presence_core->add_cluster (cluster);
      result = true;
    }

    return result;
  }
bool
audiooutput_ptlib_init (Ekiga::ServiceCore &core,
	    int */*argc*/,
	    char **/*argv*/[])
{
  bool result = false;
  Ekiga::AudioOutputCore *audiooutput_core = NULL;

  audiooutput_core
    = dynamic_cast<Ekiga::AudioOutputCore*>(core.get ("audiooutput-core"));

  if (audiooutput_core != NULL) {

    GMAudioOutputManager_ptlib *audiooutput_manager = new GMAudioOutputManager_ptlib(core);

    audiooutput_core->add_manager (*audiooutput_manager);
    result = true;
  }

  return result;
}
bool
videooutput_dx_init (Ekiga::ServiceCore &core,
                     int */*argc*/,
                     char **/*argv*/[])
{
    bool result = false;
    Ekiga::VideoOutputCore *videooutput_core = NULL;

    videooutput_core
        = dynamic_cast<Ekiga::VideoOutputCore*>(core.get ("videooutput-core"));

    if (videooutput_core != NULL) {

        GMVideoOutputManager_dx *videooutput_manager = new GMVideoOutputManager_dx(core);

        videooutput_core->add_manager (*videooutput_manager);
        result = true;
    }

    return result;
}
Esempio n. 13
0
bool
hal_dbus_init (Ekiga::ServiceCore &core,
	    int */*argc*/,
	    char **/*argv*/[])
{
  bool result = false;
  Ekiga::HalCore *hal_core = NULL;

  hal_core
    = dynamic_cast<Ekiga::HalCore*>(core.get ("hal-core"));

  if (hal_core != NULL) {

    HalManager_dbus *hal_manager = new HalManager_dbus(core);

    hal_core->add_manager (*hal_manager);
    result = true;
  }

  return result;
}
bool
local_roster_init (Ekiga::ServiceCore &core,
                   int */*argc*/,
                   char **/*argv*/[])
{
    bool result = false;
    Ekiga::PresenceCore *presence_core = NULL;
    Local::Cluster *cluster = NULL;

    presence_core
        = dynamic_cast<Ekiga::PresenceCore*>(core.get ("presence-core"));

    if (presence_core != NULL) {

        cluster = new Local::Cluster (core);
        core.add (*cluster);
        presence_core->add_cluster (*cluster);
        result = true;
    }

    return result;
}
Esempio n. 15
0
  bool try_initialize_more (Ekiga::ServiceCore& core,
			    int* /*argc*/,
			    char** /*argv*/[])
  {
    boost::shared_ptr<Ekiga::ContactCore> contact_core = core.get<Ekiga::ContactCore> ("contact-core");
    boost::shared_ptr<Ekiga::PresenceCore> presence_core = core.get<Ekiga::PresenceCore> ("presence-core");
    boost::shared_ptr<Ekiga::CallCore> call_core = core.get<Ekiga::CallCore> ("call-core");
    boost::shared_ptr<Ekiga::ChatCore> chat_core = core.get<Ekiga::ChatCore> ("chat-core");
    boost::shared_ptr<Ekiga::AccountCore> account_core = core.get<Ekiga::AccountCore> ("account-core");
    boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core = core.get<Ekiga::AudioInputCore> ("audioinput-core");
    boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core = core.get<Ekiga::VideoInputCore> ("videoinput-core");
    boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core = core.get<Ekiga::AudioOutputCore> ("audiooutput-core");
    boost::shared_ptr<Ekiga::VideoOutputCore> videooutput_core = core.get<Ekiga::VideoOutputCore> ("videooutput-core");
    boost::shared_ptr<Ekiga::PersonalDetails> personal_details = core.get<Ekiga::PersonalDetails> ("personal-details");
    boost::shared_ptr<Bank> account_store = core.get<Bank> ("opal-account-store");
    Ekiga::ServicePtr sip_endpoint = core.get ("opal-sip-endpoint");

    if (contact_core && presence_core && call_core && chat_core
	&& account_core && audioinput_core && videoinput_core
	&& audiooutput_core && videooutput_core && personal_details
	&& !account_store && !sip_endpoint) {

      hook_ekiga_plugins_to_opal (core);

      boost::shared_ptr<CallManager> call_manager (new CallManager (core));
      core.add (call_manager);

      unsigned sip_port = gm_conf_get_int (SIP_KEY "listen_port");
      boost::shared_ptr<Sip::EndPoint> sip_manager (new Sip::EndPoint (*call_manager, core, sip_port), null_deleter ());
      core.add (sip_manager);

      call_manager->add_protocol_manager (sip_manager);
      contact_core->add_contact_decorator (sip_manager);
      presence_core->add_presentity_decorator (sip_manager);

      boost::shared_ptr<Bank> bank (new Bank (core));
      account_core->add_bank (bank);
      core.add (bank);
      sip_manager->update_bank ();
      call_manager->ready.connect (boost::bind (&Opal::Bank::call_manager_ready, &*bank));
      presence_core->add_presence_publisher (bank);
      presence_core->add_presence_fetcher (bank);


#ifdef HAVE_H323
      unsigned h323_port = gm_conf_get_int (H323_KEY "listen_port");
      boost::shared_ptr<H323::EndPoint> h323_manager (new H323::EndPoint (*call_manager, core, h323_port), null_deleter ());
      call_manager->add_protocol_manager (h323_manager);
      contact_core->add_contact_decorator (h323_manager);
      presence_core->add_presentity_decorator (h323_manager);
      core.add (h323_manager);
#endif

      call_core->add_manager (call_manager);

      new ConfBridge (*call_manager); // FIXME: isn't that leaked!?

      presence_core->add_supported_uri (&is_supported_address); //FIXME

      result = true;
    }

    return result;
  }
GMAudioInputManager_null::GMAudioInputManager_null (Ekiga::ServiceCore & _core)
:    core (_core), runtime (*(dynamic_cast<Ekiga::Runtime *> (_core.get ("runtime"))))
{
  current_state.opened = false;
}