diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index d8903ad6fd4a8e46e896fa70331ebbeb1f3a9d88..ea6076d0fb7418ae58cafdb3dc420dfdc54bec97 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -832,6 +832,15 @@ sflphone_get_current_codec_name() return dbus_get_current_codec_name(selectedCall); } + void +sflphone_add_participant() +{ + DEBUG("sflphone add participant to conference"); + + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); + dbus_add_participant(selectedCall); +} + void sflphone_rec_call() { diff --git a/sflphone-client-gnome/src/actions.h b/sflphone-client-gnome/src/actions.h index 4c1951d5412a63f7763948dd35ec4a8f04a84b3b..bdddd5bf7e13a336fdfa3e227fd8db0766eccbd1 100644 --- a/sflphone-client-gnome/src/actions.h +++ b/sflphone-client-gnome/src/actions.h @@ -166,6 +166,8 @@ void sflphone_set_current_account(); */ void sflphone_fill_codec_list(); +void sflphone_add_participant(); + void sflphone_record (callable_obj_t *c); void sflphone_rec_call (void); diff --git a/sflphone-client-gnome/src/dbus/callmanager-introspec.xml b/sflphone-client-gnome/src/dbus/callmanager-introspec.xml index 539c13b6e78ccaaafc0049e473a739e43fb99584..6af63fcc617626e39024d96a116b8d98d499018b 100644 --- a/sflphone-client-gnome/src/dbus/callmanager-introspec.xml +++ b/sflphone-client-gnome/src/dbus/callmanager-introspec.xml @@ -52,6 +52,10 @@ <arg type="d" name="value" direction="out"/> </method> + <method name="addParticipant"> + <arg type="s" name="callID" direction="in"/> + </method> + <method name="setRecording"> <arg type="s" name="callID" direction="in"/> </method> diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index b4ad2226dfcaa819ac46eda8f8d09b4ef3d15952..bd70aa5c0f052fe892ebdfb374dfac5cde9c8f39 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -1228,6 +1228,25 @@ dbus_set_volume_controls( ) } } + void +dbus_add_participant(const callable_obj_t * c) +{ + + DEBUG("calling dbus_add_participant on CallManager"); + DEBUG("CallID : %s", c->_callID); + + GError* error = NULL; + org_sflphone_SFLphone_CallManager_add_participant( + callManagerProxy, + c->_callID, + &error); + if(error) + { + g_error_free(error); + } + +} + void dbus_set_record(const callable_obj_t * c) diff --git a/sflphone-client-gnome/src/dbus/dbus.h b/sflphone-client-gnome/src/dbus/dbus.h index 0c46d263da68011555309b6e774fa8de6377b6d8..7e241c9cf790092367be1d91758fb5de4689b8c2 100644 --- a/sflphone-client-gnome/src/dbus/dbus.h +++ b/sflphone-client-gnome/src/dbus/dbus.h @@ -447,6 +447,8 @@ void dbus_set_stun_server( gchar* server); gint dbus_stun_is_enabled (void); void dbus_enable_stun (void); +void dbus_add_participant(const callable_obj_t * c); + void dbus_set_record (const callable_obj_t * c); void dbus_set_record_path (const gchar *path); diff --git a/sflphone-client-gnome/src/toolbar.c b/sflphone-client-gnome/src/toolbar.c index 428e829c492b57017f527951fd3e55f67bde7a69..6b250973dbdb2e0322df6b03e615b04af17ef756 100644 --- a/sflphone-client-gnome/src/toolbar.c +++ b/sflphone-client-gnome/src/toolbar.c @@ -26,6 +26,15 @@ is_inserted( GtkWidget* button ) return ( GTK_WIDGET(button)->parent == GTK_WIDGET( toolbar ) ); } +/** + * Static create_conference + */ + static void +conference_button( GtkWidget *widget UNUSED, gpointer data UNUSED) +{ + sflphone_add_participant(); +} + /** * Static rec_button */ @@ -268,6 +277,16 @@ GtkWidget *create_toolbar () gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(recButton), -1); + conferenceButton = gtk_tool_button_new_from_stock (GTK_STOCK_MEDIA_RECORD); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(conferenceButton), _("Conference")); +#endif + gtk_widget_set_state( GTK_WIDGET(conferenceButton), GTK_STATE_INSENSITIVE); + g_signal_connect (G_OBJECT (conferenceButton), "clicked", + G_CALLBACK (conference_button), NULL); + gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(conferenceButton), -1); + + return ret; } @@ -344,6 +363,7 @@ toolbar_update_buttons () gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(recButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(conferenceButton), TRUE); break; case CALL_STATE_BUSY: case CALL_STATE_FAILURE: diff --git a/sflphone-client-gnome/src/toolbar.h b/sflphone-client-gnome/src/toolbar.h index 5af6e834e9de2cbac201408566cb3eaa0ecb0fcf..fa9c1b8c233f64bd76ea1cff02cf278c61c464d2 100644 --- a/sflphone-client-gnome/src/toolbar.h +++ b/sflphone-client-gnome/src/toolbar.h @@ -34,6 +34,7 @@ GtkToolItem * holdButton; GtkToolItem * transfertButton; GtkToolItem * unholdButton; GtkToolItem * mailboxButton; +GtkToolItem * conferenceButton; GtkToolItem * recButton; GtkToolItem * historyButton; GtkToolItem * contactButton; diff --git a/sflphone-common/src/conference.cpp b/sflphone-common/src/conference.cpp index db8e1a348966899e528c6b878805f82590f89cb3..62a4112c866c22ed637a585d01be046a8f835d24 100644 --- a/sflphone-common/src/conference.cpp +++ b/sflphone-common/src/conference.cpp @@ -60,7 +60,7 @@ void Conference::remove(CallID participant_id) ParticipantSet::iterator iter = _participants.begin(); for(iter = _participants.begin(); iter != _participants.end(); iter++) - Manager::instance().getAudioDriver()->getMainBuffer()->bindCallID(participant_id, *iter); + Manager::instance().getAudioDriver()->getMainBuffer()->unBindCallID(participant_id, *iter); } _participants.erase(participant_id); diff --git a/sflphone-common/src/dbus/callmanager-introspec.xml b/sflphone-common/src/dbus/callmanager-introspec.xml index dd7df126a9d53637a99f990388b38e8eba885561..f405c4de1ba30cda14a8dd96d4505376a8041b57 100644 --- a/sflphone-common/src/dbus/callmanager-introspec.xml +++ b/sflphone-common/src/dbus/callmanager-introspec.xml @@ -52,6 +52,10 @@ <arg type="d" name="value" direction="out"/> </method> + <method name="addParticipant"> + <arg type="s" name="callID" direction="in"/> + </method> + <method name="setRecording"> <arg type="s" name="callID" direction="in"/> </method> diff --git a/sflphone-common/src/dbus/callmanager.cpp b/sflphone-common/src/dbus/callmanager.cpp index 88f2e349a15d1ae406bc43a44879dd2aeeffceb3..4d536a50cf97c01fb8cf9a17a897e5b8fe418bdb 100644 --- a/sflphone-common/src/dbus/callmanager.cpp +++ b/sflphone-common/src/dbus/callmanager.cpp @@ -117,6 +117,13 @@ CallManager::getVolume (const std::string& device) return 0; } +void +CallManager::addParticipant (const std::string& callID) +{ + _debug ("CallManager::addParticipant received %s\n", callID.c_str()); + // Manager::instance().setRecordingCall (callID); +} + void CallManager::setRecording (const std::string& callID) { diff --git a/sflphone-common/src/dbus/callmanager.h b/sflphone-common/src/dbus/callmanager.h index 0d8a93a9a3c10591fa7409a87ecdc8081d9305e0..60f5df15afe56af692be46707cba74591a0531dd 100644 --- a/sflphone-common/src/dbus/callmanager.h +++ b/sflphone-common/src/dbus/callmanager.h @@ -48,6 +48,7 @@ public: void transfert( const std::string& callID, const std::string& to ); void setVolume( const std::string& device, const double& value ); double getVolume( const std::string& device ); + void addParticipant( const std::string& callID ); void setRecording( const std::string& callID ); bool getIsRecording(const std::string& callID); std::string getCurrentCodecName(const std::string& callID); diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 3fc1494d63ace7153b3f107087d4fd52c6207a7b..484df3e8e5ebb627267037e75bbd8a220c424bdd 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -622,6 +622,13 @@ ManagerImpl::refuseCall (const CallID& id) return returnValue; } + +void +ManagerImpl::createConference() +{ + _debug("ManagerImpl::createConference()\n"); +} + //THREAD=Main bool ManagerImpl::saveConfig (void) diff --git a/sflphone-common/src/managerimpl.h b/sflphone-common/src/managerimpl.h index eef8c251f6fbfe973f28a26b67c8dd14551a9f97..286e765263131298a08912f427c775aa63e5222e 100644 --- a/sflphone-common/src/managerimpl.h +++ b/sflphone-common/src/managerimpl.h @@ -175,6 +175,8 @@ class ManagerImpl { */ bool refuseCall(const CallID& id); + void createConference(); + /** * Save config to file * @return true on success