diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index ff46eff05e77c886e3d9d14fa5a541ffc9259d89..326434dd2934fab9b53b2e93734a2f12e241e049 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -1418,7 +1418,7 @@ sflphone_call_state_changed( callable_obj_t * c, const gchar * description, cons } -void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr) { +void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr, int size) { struct ifreq ifr; int fd; @@ -1446,7 +1446,9 @@ void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr) tmp_addr = (char *)addr_in; - snprintf(*iface_addr, sizeof(*iface_addr), "%d.%d.%d.%d", + snprintf(*iface_addr, size, "%d.%d.%d.%d", UC(tmp_addr[0]), UC(tmp_addr[1]), UC(tmp_addr[2]), UC(tmp_addr[3])); + close(fd); + } diff --git a/sflphone-client-gnome/src/actions.h b/sflphone-client-gnome/src/actions.h index 2d956ddb8073899245301cc042904f1cfb91ceb6..eb63c0eeb5351afeabcaec122e4c804017b6f4b7 100644 --- a/sflphone-client-gnome/src/actions.h +++ b/sflphone-client-gnome/src/actions.h @@ -289,5 +289,5 @@ void sflphone_call_state_changed(callable_obj_t * c, const gchar * description, /** * Resolve an interface address given its name */ -void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr); +void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr, int size); #endif diff --git a/sflphone-client-gnome/src/config/accountconfigdialog.c b/sflphone-client-gnome/src/config/accountconfigdialog.c index 1b2e5e8b43f26438a1e9851f63ce7a806a763fae..07efb73cd3abad3567929d2be76ec79642f0cabc 100644 --- a/sflphone-client-gnome/src/config/accountconfigdialog.c +++ b/sflphone-client-gnome/src/config/accountconfigdialog.c @@ -641,7 +641,7 @@ static local_interface_changed_cb(GtkWidget * widget, gpointer data UNUSED) { local_iface_name = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo)); // sflphone_get_interface_addr_from_name((char *)local_interface); - sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr); + sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr, 36); gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr); gtk_entry_set_text (GTK_ENTRY(publishedAddressEntry), local_iface_addr); @@ -1007,7 +1007,7 @@ GtkWidget* create_network (account_t **a) { gchar *local_iface_addr; gchar *local_iface_name; - local_iface_addr= g_malloc(18); + local_iface_addr= g_malloc(36); if (iface_list != NULL) { @@ -1050,7 +1050,7 @@ GtkWidget* create_network (account_t **a) { // Fill the text entry with the ip address of local interface selected localAddressEntry = gtk_entry_new(); local_iface_name = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo)); - sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr); + sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr, 36); gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr); gtk_widget_set_sensitive(localAddressEntry, FALSE); gtk_table_attach ( GTK_TABLE( table ), localAddressEntry, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 08c23fc96efb8b58537778c0f9c96dc7fc9916f3..ec4f422d0667b12d99eb47d59fc69dd070ea86dc 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -1150,16 +1150,16 @@ void ManagerImpl::detachParticipant (const CallID& call_id, iter_details = call_details.find("CALL_STATE"); if (iter_details->second == "RINGING") { - removeParticipant(call_id); - } else { - _debug (" ONHOLD %s", call_id.c_str()); - onHoldCall(call_id); - removeParticipant(call_id); - processRemainingParticipant(current_call_id, conf); + removeParticipant(call_id); + } + else { + onHoldCall(call_id); + removeParticipant(call_id); + processRemainingParticipant(current_call_id, conf); - _dbus->getCallManager()->conferenceChanged(conf->getConfID(), - conf->getStateStr()); + _dbus->getCallManager()->conferenceChanged(conf->getConfID(), + conf->getStateStr()); } } else { @@ -1225,7 +1225,8 @@ void ManagerImpl::removeParticipant (const CallID& call_id) { void ManagerImpl::processRemainingParticipant (CallID current_call_id, Conference *conf) { - _debug ("Manager: Process remaining participant"); + _debug ("Manager: Process remaining %d participant(s) from conference %s", + conf->getNbParticipants(), conf->getConfID().c_str()); if (conf->getNbParticipants() > 1) { @@ -1254,7 +1255,6 @@ void ManagerImpl::processRemainingParticipant (CallID current_call_id, ParticipantSet::iterator iter_participant = participants.begin(); // bind main participant to remaining conference call - if (iter_participant != participants.end()) { // this call is no more a conference participant @@ -1272,6 +1272,7 @@ void ManagerImpl::processRemainingParticipant (CallID current_call_id, } removeConference(conf->getConfID()); + } else { _debug ("Manager: No remaining participant, remove conference");