diff --git a/sflphone-client-gnome/src/config/accountconfigdialog.c b/sflphone-client-gnome/src/config/accountconfigdialog.c index a63ca9f936aa17abfc4f2b809c1c4bd82cd55e97..550019774a52be16a6cb66825d48a76f93377547 100644 --- a/sflphone-client-gnome/src/config/accountconfigdialog.c +++ b/sflphone-client-gnome/src/config/accountconfigdialog.c @@ -718,8 +718,7 @@ GtkWidget * create_advanced_tab(account_t **a) DEBUG("Interface %s", *iface); gtk_list_store_append(ipInterfaceListStore, &iter ); gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1 ); - - current_local_address_iter = iter; + if (g_strcmp0(*iface, local_address) == 0) { DEBUG("Setting active local address combo box"); current_local_address_iter = iter; diff --git a/sflphone-client-gnome/src/config/assistant.c b/sflphone-client-gnome/src/config/assistant.c index 1f62ab5617eb47816479acaebfeac86027af2821..f9431a66ae05e7072a6bee8dde288b42e541db12 100644 --- a/sflphone-client-gnome/src/config/assistant.c +++ b/sflphone-client-gnome/src/config/assistant.c @@ -147,14 +147,27 @@ static void sip_apply_callback( void ) { g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ZRTP_HELLO_HASH), g_strdup((gchar *)"true")); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_DISPLAY_SAS_ONCE), g_strdup((gchar *)"false")); } - - dbus_add_account( current ); - getMessageSummary(message, - gtk_entry_get_text (GTK_ENTRY(wiz->sip_alias)), - gtk_entry_get_text (GTK_ENTRY(wiz->sip_server)), - gtk_entry_get_text (GTK_ENTRY(wiz->sip_username)), - (gboolean)(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wiz->zrtp_enable))) - ); + + + // Add default interface info + gchar ** iface_list = NULL; + iface_list = (gchar**) dbus_get_all_ip_interface(); + gchar ** iface = NULL; + + // select the first interface available + iface = iface_list; + DEBUG("Selected interface %s", *iface); + + g_hash_table_insert(current->properties, g_strdup(LOCAL_ADDRESS), g_strdup((gchar *)*iface)); + g_hash_table_insert(current->properties, g_strdup(PUBLISHED_ADDRESS), g_strdup((gchar *)*iface)); + + dbus_add_account( current ); + getMessageSummary(message, + gtk_entry_get_text (GTK_ENTRY(wiz->sip_alias)), + gtk_entry_get_text (GTK_ENTRY(wiz->sip_server)), + gtk_entry_get_text (GTK_ENTRY(wiz->sip_username)), + (gboolean)(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wiz->zrtp_enable))) + ); gtk_label_set_text (GTK_LABEL(wiz->label_summary), message); } diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp index 5bd2b417409bc9d144b0eecc86561d3acf509ac8..6fb1b24947398574d2a30c76340704df2efb7b1e 100644 --- a/sflphone-common/src/sip/sipvoiplink.cpp +++ b/sflphone-common/src/sip/sipvoiplink.cpp @@ -2888,12 +2888,18 @@ mod_on_rx_request (pjsip_rx_data *rdata) char* from_header = strstr(rdata->msg_info.msg_buf, "From: "); // _debug("------------------------------ thefromheader: %s\n", from_header); - std::string temp(from_header); - int begin_displayName = temp.find("\"") + 1; - int end_displayName = temp.rfind("\""); - // _debug("The display name start at %i, end at %i\n", begin_displayName, end_displayName); - - displayName = temp.substr(begin_displayName, end_displayName - begin_displayName);//display_name); + + if(from_header) { + + std::string temp(from_header); + int begin_displayName = temp.find("\"") + 1; + int end_displayName = temp.rfind("\""); + // _debug("The display name start at %i, end at %i\n", begin_displayName, end_displayName); + displayName = temp.substr(begin_displayName, end_displayName - begin_displayName);//display_name); + } + else { + displayName = std::string(""); + } _debug ("UserAgent: The receiver is : %s@%s\n", userName.data(), server.data());