ekiga-03-sunray-port-conflict.diff revision 10430
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync--- ekiga-2.0.3/src/endpoints/manager.cpp.old 2006-11-09 13:35:29.753351000 +0800
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+++ ekiga-2.0.3/src/endpoints/manager.cpp 2006-11-09 14:26:11.441035000 +0800
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync@@ -1592,14 +1592,20 @@
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync gnomemeeting_threads_leave ();
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync h323EP->RemoveListener (NULL);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- if (!h323EP->StartListener (iface, port)) {
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync-
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- gnomemeeting_threads_enter ();
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- 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."));
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- if (gtk_window_is_active (GTK_WINDOW (druid)))
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- gtk_widget_set_parent (dialog, druid);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- gnomemeeting_threads_leave ();
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- }
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ //Port conflict occured when multiple ekiga instances or DTUs connected with the same SunRay server
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ //since H.323 uses 1720 as default listen port and SIP uses 5060
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ //This patch is trying to find the available one in the 10 continous ports from the default
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ for (int i = 0 ; i < 10 ; i++)
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ if (h323EP->StartListener (iface, port++)) {
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ break;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ }
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ else if (i >= 9) {
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ gnomemeeting_threads_enter ();
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ 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."));
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ if (gtk_window_is_active (GTK_WINDOW (druid)))
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ gtk_widget_set_parent (dialog, druid);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ gnomemeeting_threads_leave ();
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ }
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync }
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync if (sipEP) {
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync@@ -1609,14 +1615,17 @@
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync gnomemeeting_threads_leave ();
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync sipEP->RemoveListener (NULL);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- if (!sipEP->StartListener (iface, port)) {
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync-
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- gnomemeeting_threads_enter ();
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- 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."));
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- if (gtk_window_is_active (GTK_WINDOW (druid)))
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- gtk_widget_set_parent (dialog, druid);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- gnomemeeting_threads_leave ();
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync- }
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ for (int i = 0 ; i < 10 ; i++)
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ if (sipEP->StartListener (iface, port++)) {
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ break;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ }
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ else if (i >= 9) {
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ gnomemeeting_threads_enter ();
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ 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."));
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ if (gtk_window_is_active (GTK_WINDOW (druid)))
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ gtk_widget_set_parent (dialog, druid);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ gnomemeeting_threads_leave ();
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync+ }
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync }
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync g_free (iface);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync