10430N/A--- ekiga-2.0.3/src/endpoints/manager.cpp.old 2006-11-09 13:35:29.753351000 +0800
10430N/A+++ ekiga-2.0.3/src/endpoints/manager.cpp 2006-11-09 14:26:11.441035000 +0800
10430N/A@@ -1592,14 +1592,20 @@
10430N/A gnomemeeting_threads_leave ();
10430N/A
10430N/A h323EP->RemoveListener (NULL);
10430N/A- if (!h323EP->StartListener (iface, port)) {
10430N/A-
10430N/A- gnomemeeting_threads_enter ();
10430N/A- dialog = gnomemeeting_error_dialog (GTK_WINDOW (main_window), _("Error while starting the listener for the H.323 protocol"), _("You will not be able to receive incoming H.323 calls. Please check that no other program is already running on the port used by Ekiga."));
10430N/A- if (gtk_window_is_active (GTK_WINDOW (druid)))
10430N/A- gtk_widget_set_parent (dialog, druid);
10430N/A- gnomemeeting_threads_leave ();
10430N/A- }
16654N/A+ //Port conflict occured when multiple ekiga instances or DTUs connected with the same Sun Ray server
10430N/A+ //since H.323 uses 1720 as default listen port and SIP uses 5060
10430N/A+ //This patch is trying to find the available one in the 10 continous ports from the default
10430N/A+ for (int i = 0 ; i < 10 ; i++)
10430N/A+ if (h323EP->StartListener (iface, port++)) {
10430N/A+ break;
10430N/A+ }
10430N/A+ else if (i >= 9) {
10430N/A+ gnomemeeting_threads_enter ();
10430N/A+ dialog = gnomemeeting_error_dialog (GTK_WINDOW (main_window), _("Error while starting the listener for the H.323 protocol"), _("You will not be able to receive incoming H.323 calls. Please check that no other program is already running on the port used by Ekiga."));
10430N/A+ if (gtk_window_is_active (GTK_WINDOW (druid)))
10430N/A+ gtk_widget_set_parent (dialog, druid);
10430N/A+ gnomemeeting_threads_leave ();
10430N/A+ }
10430N/A }
10430N/A
10430N/A if (sipEP) {
10430N/A@@ -1609,14 +1615,17 @@
10430N/A gnomemeeting_threads_leave ();
10430N/A
10430N/A sipEP->RemoveListener (NULL);
10430N/A- if (!sipEP->StartListener (iface, port)) {
10430N/A-
10430N/A- gnomemeeting_threads_enter ();
10430N/A- dialog = gnomemeeting_error_dialog (GTK_WINDOW (main_window), _("Error while starting the listener for the SIP protocol"), _("You will not be able to receive incoming SIP calls. Please check that no other program is already running on the port used by Ekiga."));
10430N/A- if (gtk_window_is_active (GTK_WINDOW (druid)))
10430N/A- gtk_widget_set_parent (dialog, druid);
10430N/A- gnomemeeting_threads_leave ();
10430N/A- }
10430N/A+ for (int i = 0 ; i < 10 ; i++)
10430N/A+ if (sipEP->StartListener (iface, port++)) {
10430N/A+ break;
10430N/A+ }
10430N/A+ else if (i >= 9) {
10430N/A+ gnomemeeting_threads_enter ();
10430N/A+ dialog = gnomemeeting_error_dialog (GTK_WINDOW (main_window), _("Error while starting the listener for the SIP protocol"), _("You will not be able to receive incoming SIP calls. Please check that no other program is already running on the port used by Ekiga."));
10430N/A+ if (gtk_window_is_active (GTK_WINDOW (druid)))
10430N/A+ gtk_widget_set_parent (dialog, druid);
10430N/A+ gnomemeeting_threads_leave ();
10430N/A+ }
10430N/A }
10430N/A
10430N/A g_free (iface);