ekiga r6319 - in trunk: . src/endpoints
- From: dsandras svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r6319 - in trunk: . src/endpoints
- Date: Sun, 25 May 2008 20:34:46 +0000 (UTC)
Author: dsandras
Date: Sun May 25 20:34:45 2008
New Revision: 6319
URL: http://svn.gnome.org/viewvc/ekiga?rev=6319&view=rev
Log:
A CallProtocolManager is now created with the listen port as argument
so that it can start listening on the correct port as soon as it is
created. Added a start () method to the GMManager so that we can
trigger the STUNDetector only when all CallProtocolManagers are active
and running.
Modified:
trunk/ChangeLog
trunk/src/endpoints/manager.cpp
trunk/src/endpoints/manager.h
trunk/src/endpoints/opal-gmconf-bridge.cpp
trunk/src/endpoints/opal-main.cpp
trunk/src/endpoints/sip.cpp
trunk/src/endpoints/sip.h
Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp (original)
+++ trunk/src/endpoints/manager.cpp Sun May 25 20:34:45 2008
@@ -150,9 +150,6 @@
//
call_core = dynamic_cast<Ekiga::CallCore *> (core.get ("call-core"));
-
- // Ready
- new StunDetector ("stun.voxgratia.org", *this, runtime);
}
@@ -163,6 +160,13 @@
}
+void GMManager::start ()
+{
+ // Ready
+ new StunDetector ("stun.voxgratia.org", *this, runtime);
+}
+
+
void GMManager::set_display_name (const std::string & name)
{
display_name = name;
Modified: trunk/src/endpoints/manager.h
==============================================================================
--- trunk/src/endpoints/manager.h (original)
+++ trunk/src/endpoints/manager.h Sun May 25 20:34:45 2008
@@ -86,6 +86,9 @@
~GMManager ();
/**/
+ void start ();
+
+ /**/
const std::string get_name () const
{ return "opal-component"; }
Modified: trunk/src/endpoints/opal-gmconf-bridge.cpp
==============================================================================
--- trunk/src/endpoints/opal-gmconf-bridge.cpp (original)
+++ trunk/src/endpoints/opal-gmconf-bridge.cpp Sun May 25 20:34:45 2008
@@ -75,7 +75,6 @@
keys.push_back (SIP_KEY "outbound_proxy_host");
keys.push_back (SIP_KEY "dtmf_mode");
keys.push_back (SIP_KEY "binding_timeout");
- keys.push_back (SIP_KEY "listen_port");
keys.push_back (PERSONAL_DATA_KEY "full_name");
@@ -248,10 +247,6 @@
sip_manager->set_nat_binding_delay (gm_conf_entry_get_int (entry));
}
- else if (key == SIP_KEY "listen_port") {
-
- sip_manager->set_listen_port (gm_conf_entry_get_int (entry));
- }
}
}
Modified: trunk/src/endpoints/opal-main.cpp
==============================================================================
--- trunk/src/endpoints/opal-main.cpp (original)
+++ trunk/src/endpoints/opal-main.cpp Sun May 25 20:34:45 2008
@@ -59,20 +59,21 @@
int * /*argc*/,
char ** /*argv*/[])
{
- bool result = true;
-
Ekiga::ContactCore *contact_core = NULL;
Ekiga::PresenceCore *presence_core = NULL;
Ekiga::CallCore *call_core = NULL;
Ekiga::ChatCore *chat_core = NULL;
-
+
+ bool result = true;
+ unsigned sip_port = gm_conf_get_int (SIP_KEY "listen_port");
+
contact_core = dynamic_cast<Ekiga::ContactCore *> (core.get ("contact-core"));
presence_core = dynamic_cast<Ekiga::PresenceCore *> (core.get ("presence-core"));
call_core = dynamic_cast<Ekiga::CallCore *> (core.get ("call-core"));
chat_core = dynamic_cast<Ekiga::ChatCore *> (core.get ("chat-core"));
GMManager *manager = new GMManager (core);
- GMSIPEndpoint *sipEP = new GMSIPEndpoint (*manager, core);
+ GMSIPEndpoint *sipEP = new GMSIPEndpoint (*manager, core, sip_port);
manager->AddRouteEntry("pc:.* = sip:<da>");
manager->add_protocol_manager (*sipEP);
@@ -82,6 +83,7 @@
chat_core->add_manager (*sipEP);
new Opal::ConfBridge (*manager);
+ manager->start ();
// FIXME Service ?
if (contact_core != NULL)
Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp (original)
+++ trunk/src/endpoints/sip.cpp Sun May 25 20:34:45 2008
@@ -75,7 +75,7 @@
/* The class */
-GMSIPEndpoint::GMSIPEndpoint (GMManager & ep, Ekiga::ServiceCore & _core)
+GMSIPEndpoint::GMSIPEndpoint (GMManager & ep, Ekiga::ServiceCore & _core, unsigned _listen_port)
: SIPEndPoint (ep),
Ekiga::PresencePublisher (_core),
endpoint (ep),
@@ -85,7 +85,7 @@
{
protocol_name = "sip";
uri_prefix = "sip:";
- listen_port = 5060;
+ listen_port = _listen_port;
/* Timeouts */
SetAckTimeout (PTimeInterval (0, 32));
@@ -94,6 +94,9 @@
SetNonInviteTimeout (PTimeInterval (0, 6));
SetRetryTimeouts (500, 4000);
SetMaxRetries (8);
+
+ /* Start listener */
+ set_listen_port (listen_port);
/* Update the User Agent */
SetUserAgent ("Ekiga/" PACKAGE_VERSION);
Modified: trunk/src/endpoints/sip.h
==============================================================================
--- trunk/src/endpoints/sip.h (original)
+++ trunk/src/endpoints/sip.h Sun May 25 20:34:45 2008
@@ -68,7 +68,7 @@
public:
- GMSIPEndpoint (GMManager &ep, Ekiga::ServiceCore & core);
+ GMSIPEndpoint (GMManager &ep, Ekiga::ServiceCore & core, unsigned listen_port);
/***/
bool populate_menu (Ekiga::Contact &contact,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]