diff --git a/sflphone-client-gnome/src/config/accountconfigdialog.c b/sflphone-client-gnome/src/config/accountconfigdialog.c index 327f356ead6a8d3457064ec50f443fb06c783ace..02b19959f83886748d963a02ebf52c9603d2d30e 100644 --- a/sflphone-client-gnome/src/config/accountconfigdialog.c +++ b/sflphone-client-gnome/src/config/accountconfigdialog.c @@ -757,6 +757,7 @@ GtkWidget * create_advanced_tab(account_t **a) gchar * use_tls; gchar * published_address; gchar * published_port; + gchar * local_interface; gchar * local_address; gchar * local_port; gchar * stun_enable; @@ -772,6 +773,9 @@ GtkWidget * create_advanced_tab(account_t **a) published_sameas_local = g_hash_table_lookup(currentAccount->properties, PUBLISHED_SAMEAS_LOCAL); + local_interface = g_hash_table_lookup(currentAccount->properties, LOCAL_INTERFACE); + + local_port = g_hash_table_lookup(currentAccount->properties, LOCAL_PORT); local_address = g_hash_table_lookup(currentAccount->properties, LOCAL_ADDRESS); @@ -849,7 +853,7 @@ GtkWidget * create_advanced_tab(account_t **a) gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1 ); // set the current local address - if (!iface_found && (g_strcmp0(*iface, local_address) == 0)) { + if (!iface_found && (g_strcmp0(*iface, local_interface) == 0)) { DEBUG("Setting active local address combo box"); current_local_address_iter = iter; iface_found = TRUE; @@ -1114,9 +1118,13 @@ show_account_window (account_t * a) g_hash_table_replace(currentAccount->properties, g_strdup(PUBLISHED_SAMEAS_LOCAL), g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton)) ? "true":"false")); + g_hash_table_replace(currentAccount->properties, + g_strdup(LOCAL_INTERFACE), + g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)))); + g_hash_table_replace(currentAccount->properties, g_strdup(LOCAL_PORT), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); g_hash_table_replace(currentAccount->properties, g_strdup(LOCAL_ADDRESS), @@ -1136,6 +1144,7 @@ show_account_window (account_t * a) g_hash_table_replace(currentAccount->properties, g_strdup(PUBLISHED_PORT), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); + g_hash_table_replace(currentAccount->properties, g_strdup(PUBLISHED_ADDRESS), diff --git a/sflphone-client-gnome/src/config/preferencesdialog.c b/sflphone-client-gnome/src/config/preferencesdialog.c index fddc259eedff545180de9d2c052b4a41ab96b53f..13257f4c913f86ed62c56ec570b58e5963a0fba1 100644 --- a/sflphone-client-gnome/src/config/preferencesdialog.c +++ b/sflphone-client-gnome/src/config/preferencesdialog.c @@ -165,7 +165,7 @@ static void use_sip_tls_cb(GtkWidget *widget, gpointer data) static void ip2ip_local_address_changed_cb(GtkWidget *widget, gpointer data) { DEBUG("ip2ip_local_address_changed_cb\n"); - g_hash_table_replace(directIpCallsProperties, g_strdup(LOCAL_ADDRESS), g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)))); + g_hash_table_replace(directIpCallsProperties, g_strdup(LOCAL_INTERFACE), g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)))); } static void ip2ip_local_port_changed_cb(GtkWidget *widget, gpointer data) @@ -199,6 +199,7 @@ GtkWidget* create_direct_ip_calls_tab() gchar * curKeyExchange = "0"; gchar * description; + gchar * local_interface; gchar * local_address; gchar * local_port; @@ -207,8 +208,10 @@ GtkWidget* create_direct_ip_calls_tab() if(directIpCallsProperties != NULL) { DEBUG("got a directIpCallsProperties"); + local_interface = g_hash_table_lookup(directIpCallsProperties, LOCAL_INTERFACE); local_address = g_hash_table_lookup(directIpCallsProperties, LOCAL_ADDRESS); local_port = g_hash_table_lookup(directIpCallsProperties, LOCAL_PORT); + DEBUG(" local interface = %s", local_interface); DEBUG(" local address = %s", local_address); DEBUG(" local port = %s", local_port); curSRTPEnabled = g_hash_table_lookup(directIpCallsProperties, ACCOUNT_SRTP_ENABLED); @@ -264,7 +267,7 @@ GtkWidget* create_direct_ip_calls_tab() gtk_list_store_append(ipInterfaceListStore, &iter ); gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1 ); - if (!iface_found && (g_strcmp0(*iface, local_address) == 0)) { + if (!iface_found && (g_strcmp0(*iface, local_interface) == 0)) { DEBUG("Setting active local address combo box"); current_local_address_iter = iter; iface_found = TRUE; @@ -292,7 +295,7 @@ GtkWidget* create_direct_ip_calls_tab() gtk_combo_box_set_active_iter(GTK_COMBO_BOX(localAddressCombo), ¤t_local_address_iter); g_signal_connect (G_OBJECT(GTK_COMBO_BOX(localAddressCombo)), "changed", G_CALLBACK (ip2ip_local_address_changed_cb), localAddressCombo); - g_hash_table_replace(directIpCallsProperties, g_strdup(LOCAL_ADDRESS), g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)))); + g_hash_table_replace(directIpCallsProperties, g_strdup(LOCAL_INTERFACE), g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)))); /** diff --git a/sflphone-client-gnome/src/sflphone_const.h b/sflphone-client-gnome/src/sflphone_const.h index b63a3e17e17b6dd1d1515266277215bf7c09bac4..485e755dc0148fcce6a9066b698c83cb09f85031 100644 --- a/sflphone-client-gnome/src/sflphone_const.h +++ b/sflphone-client-gnome/src/sflphone_const.h @@ -88,6 +88,7 @@ #define TLS_NEGOTIATION_TIMEOUT_SEC "TLS.negotiationTimeoutSec" #define TLS_NEGOTIATION_TIMEOUT_MSEC "TLS.negotiationTimemoutMsec" +#define LOCAL_INTERFACE "Account.localInterface" #define PUBLISHED_SAMEAS_LOCAL "Account.publishedSameAsLocal" #define LOCAL_PORT "Account.localPort" #define LOCAL_ADDRESS "Account.localAddress" diff --git a/sflphone-common/src/dbus/configurationmanager.cpp b/sflphone-common/src/dbus/configurationmanager.cpp index 7b13da09a8a678572b88ab4e79be888dc0c25469..05fdc738f396a784299f74ddc73ce1817104b859 100644 --- a/sflphone-common/src/dbus/configurationmanager.cpp +++ b/sflphone-common/src/dbus/configurationmanager.cpp @@ -77,6 +77,7 @@ ConfigurationManager::getIp2IpDetails (void) ip2ipAccountDetails.insert (std::pair<std::string, std::string> (ZRTP_NOT_SUPP_WARNING, Manager::instance().getConfigString (IP2IP_PROFILE, ZRTP_NOT_SUPP_WARNING))); ip2ipAccountDetails.insert (std::pair<std::string, std::string> (ZRTP_DISPLAY_SAS_ONCE, Manager::instance().getConfigString (IP2IP_PROFILE, ZRTP_DISPLAY_SAS_ONCE))); + ip2ipAccountDetails.insert (std::pair<std::string, std::string> (LOCAL_INTERFACE, Manager::instance().getConfigString(IP2IP_PROFILE, LOCAL_INTERFACE))); ip2ipAccountDetails.insert (std::pair<std::string, std::string> (LOCAL_ADDRESS, Manager::instance().getConfigString (IP2IP_PROFILE, LOCAL_ADDRESS))); ip2ipAccountDetails.insert (std::pair<std::string, std::string> (LOCAL_PORT, Manager::instance().getConfigString (IP2IP_PROFILE, LOCAL_PORT))); @@ -94,6 +95,12 @@ ConfigurationManager::setIp2IpDetails (const std::map< std::string, std::string std::map<std::string, std::string> map_cpy = details; std::map<std::string, std::string>::iterator it; + it = map_cpy.find (LOCAL_INTERFACE); + + if (it != details.end()) { + Manager::instance().setConfig (IP2IP_PROFILE, LOCAL_INTERFACE, it->second); + } + it = map_cpy.find (LOCAL_ADDRESS); if (it != details.end()) { diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 29dcc62fd96cae5c4712ff7ca0c7a2036fdcbfaf..d4cd94ab24dd5343b34301e96332acdc1ef13116 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -3536,6 +3536,7 @@ std::map< std::string, std::string > ManagerImpl::getAccountDetails (const Accou a.insert (std::pair<std::string, std::string> (AUTHENTICATION_USERNAME, getConfigString (accountID, AUTHENTICATION_USERNAME))); a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_MAILBOX, getConfigString (accountID, CONFIG_ACCOUNT_MAILBOX))); a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_REGISTRATION_EXPIRE, getConfigString (accountID, CONFIG_ACCOUNT_REGISTRATION_EXPIRE))); + a.insert (std::pair<std::string, std::string> (LOCAL_INTERFACE, getConfigString (accountID, LOCAL_INTERFACE))); a.insert (std::pair<std::string, std::string> (PUBLISHED_SAMEAS_LOCAL, getConfigString (accountID, PUBLISHED_SAMEAS_LOCAL))); a.insert (std::pair<std::string, std::string> (LOCAL_ADDRESS, getConfigString (accountID, LOCAL_ADDRESS))); a.insert (std::pair<std::string, std::string> (PUBLISHED_ADDRESS, getConfigString (accountID, PUBLISHED_ADDRESS)));