diff --git a/daemon/src/call.cpp b/daemon/src/call.cpp index df9d4ad1c97f9cb16a87f7de1157a80f4c9e2021..f549a2f5e4e67e08ef781d7e870a3d79a1428818 100644 --- a/daemon/src/call.cpp +++ b/daemon/src/call.cpp @@ -93,7 +93,7 @@ Call::getStateStr() return isIncoming() ? "INCOMING" : "RINGING"; case CONNECTED: default: - return isRecording() ? "RECORD" : "CURRENT"; + return "CURRENT"; } case HOLD: diff --git a/daemon/src/dbus/callmanager-introspec.xml b/daemon/src/dbus/callmanager-introspec.xml index a85e77732a1c548221b6d5d19eca3e0d06eb667a..07630ac456e632f1bc898bd6f8fb6a94bf714681 100644 --- a/daemon/src/dbus/callmanager-introspec.xml +++ b/daemon/src/dbus/callmanager-introspec.xml @@ -514,8 +514,7 @@ <li>BUSY</li> <li>FAILURE: Error when processing a call</li> <li>HOLD</li> - <li>UNHOLD_CURRENT</li> - <li>UNHOLD_RECORD</li> + <li>UNHOLD</li> </ul> </tp:docstring> </arg> diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index b37627eea9d344dd8a6ee4cdbf31b89718c2156b..65aa2d8b00a889fb25276a6b377a9f6231b92dd2 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -329,11 +329,7 @@ bool ManagerImpl::answerCall(const std::string& call_id) setRecordingCall(call_id); // update call state on client side - if (audioPreference.getIsAlwaysRecording()) - dbus_.getCallManager()->callStateChanged(call_id, "RECORD"); - else - dbus_.getCallManager()->callStateChanged(call_id, "CURRENT"); - + dbus_.getCallManager()->callStateChanged(call_id, "CURRENT"); return true; } @@ -488,8 +484,6 @@ void ManagerImpl::offHoldCall(const std::string& callId) detachParticipant(MainBuffer::DEFAULT_ID, currentCallId); } - bool isRec = false; - if (isIPToIP(callId)) SIPVoIPLink::instance()->offhold(callId); else { @@ -498,13 +492,11 @@ void ManagerImpl::offHoldCall(const std::string& callId) DEBUG("Setting offhold, Account %s, callid %s", accountId.c_str(), callId.c_str()); Call * call = getAccountLink(accountId)->getCall(callId); - if (call) { - isRec = call->isRecording(); + if (call) getAccountLink(accountId)->offhold(callId); - } } - dbus_.getCallManager()->callStateChanged(callId, isRec ? "UNHOLD_RECORD" : "UNHOLD_CURRENT"); + dbus_.getCallManager()->callStateChanged(callId, "UNHOLD"); if (isConferenceParticipant(callId)) { Call *call = getCallFromCallID(callId); @@ -929,11 +921,9 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& } else if (call1_state_str == "INCOMING") { conf->bindParticipant(callId1); answerCall(callId1); - } else if (call1_state_str == "CURRENT") - conf->bindParticipant(callId1); - else if (call1_state_str == "RECORD") + } else if (call1_state_str == "CURRENT") { conf->bindParticipant(callId1); - else if (call1_state_str == "INACTIVE") { + } else if (call1_state_str == "INACTIVE") { conf->bindParticipant(callId1); answerCall(callId1); } else @@ -949,11 +939,9 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& } else if (call2_state_str == "INCOMING") { conf->bindParticipant(callId2); answerCall(callId2); - } else if (call2_state_str == "CURRENT") - conf->bindParticipant(callId2); - else if (call2_state_str == "RECORD") + } else if (call2_state_str == "CURRENT") { conf->bindParticipant(callId2); - else if (call2_state_str == "INACTIVE") { + } else if (call2_state_str == "INACTIVE") { conf->bindParticipant(callId2); answerCall(callId2); } else @@ -1520,11 +1508,10 @@ void ManagerImpl::peerAnsweredCall(const std::string& id) audiodriver_->flushUrgent(); } - if (audioPreference.getIsAlwaysRecording()) { + if (audioPreference.getIsAlwaysRecording()) setRecordingCall(id); - dbus_.getCallManager()->callStateChanged(id, "RECORD"); - } else - dbus_.getCallManager()->callStateChanged(id, "CURRENT"); + + dbus_.getCallManager()->callStateChanged(id, "CURRENT"); } //THREAD=VoIP Call=Outgoing diff --git a/gnome/src/actions.c b/gnome/src/actions.c index 8638789bec03cc2c172b5fd93e38f6a2dd6d0926..4e0689bcddd291f01086267f41d55d1a82280b20 100644 --- a/gnome/src/actions.c +++ b/gnome/src/actions.c @@ -312,7 +312,6 @@ sflphone_hang_up() case CALL_STATE_CURRENT: case CALL_STATE_HOLD: case CALL_STATE_BUSY: - case CALL_STATE_RECORD: dbus_hang_up(selectedCall); call_remove_all_errors(selectedCall); selectedCall->_state = CALL_STATE_DIALING; @@ -398,7 +397,6 @@ sflphone_pick_up() break; case CALL_STATE_CURRENT: case CALL_STATE_HOLD: - case CALL_STATE_RECORD: case CALL_STATE_RINGING: sflphone_new_call(); break; @@ -417,7 +415,6 @@ sflphone_on_hold() if (selectedCall) { switch (selectedCall->_state) { case CALL_STATE_CURRENT: - case CALL_STATE_RECORD: dbus_hold(selectedCall); break; default: @@ -476,17 +473,6 @@ sflphone_current(callable_obj_t * c) update_actions(); } -void -sflphone_record(callable_obj_t * c) -{ - if (c->_state != CALL_STATE_HOLD) - time(&c->_time_start); - - c->_state = CALL_STATE_RECORD; - calltree_update_call(current_calls_tab, c); - update_actions(); -} - void sflphone_set_transfer() { @@ -659,7 +645,6 @@ sflphone_keypad(guint keyval, gchar * key) case CALL_STATE_DIALING: // Currently dialing => edit number process_dialing(c, keyval, key); break; - case CALL_STATE_RECORD: case CALL_STATE_CURRENT: switch (keyval) { @@ -855,19 +840,6 @@ sflphone_rec_call() if (selectedCall) { DEBUG("Set record for selected call"); dbus_set_record(selectedCall->_callID); - - switch (selectedCall->_state) { - case CALL_STATE_CURRENT: - selectedCall->_state = CALL_STATE_RECORD; - break; - case CALL_STATE_RECORD: - selectedCall->_state = CALL_STATE_CURRENT; - break; - default: - WARN("Should not happen in sflphone_off_hold ()!"); - break; - } - calltree_update_call(current_calls_tab, selectedCall); } else if (selectedConf) { DEBUG("Set record for selected conf"); diff --git a/gnome/src/actions.h b/gnome/src/actions.h index 4bb3cbdf1382a3a336a1cb2447026d8a5cf2891f..e0d466f792ec7aba530d717ee03eb06a9fce9c2b 100644 --- a/gnome/src/actions.h +++ b/gnome/src/actions.h @@ -192,8 +192,6 @@ void sflphone_fill_codec_list_per_account(account_t *); void sflphone_add_participant(); -void sflphone_record(callable_obj_t *c); - void sflphone_rec_call(void); void sflphone_mute_call(void); diff --git a/gnome/src/callable_obj.h b/gnome/src/callable_obj.h index b8cfaca0e70623fac7d13d01adf45ea2b68f98ed..5c9eeaec69907e038cf684b47998b0b76e4048ee 100644 --- a/gnome/src/callable_obj.h +++ b/gnome/src/callable_obj.h @@ -69,7 +69,6 @@ typedef enum { CALL_STATE_FAILURE, CALL_STATE_BUSY, CALL_STATE_TRANSFER, - CALL_STATE_RECORD, } call_state_t; static const char * const TIMESTAMP_START_KEY = "timestamp_start"; diff --git a/gnome/src/contacts/calltree.c b/gnome/src/contacts/calltree.c index a1a10a4835e9390c7fe93c8df411975d43eff375..044bccdd77388a2ff93302ad37006f519b13cf79 100644 --- a/gnome/src/contacts/calltree.c +++ b/gnome/src/contacts/calltree.c @@ -648,7 +648,10 @@ update_call(GtkTreeModel *model, GtkTreePath *path UNUSED, GtkTreeIter *iter, gp pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); break; case CALL_STATE_CURRENT: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); + if (dbus_get_is_recording(call)) + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/icon_rec.svg", NULL); + else + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); break; case CALL_STATE_DIALING: pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); @@ -662,9 +665,6 @@ update_call(GtkTreeModel *model, GtkTreePath *path UNUSED, GtkTreeIter *iter, gp case CALL_STATE_TRANSFER: pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/transfer.svg", NULL); break; - case CALL_STATE_RECORD: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/icon_rec.svg", NULL); - break; default: WARN("Update calltree - Should not happen!"); } @@ -783,15 +783,15 @@ void calltree_add_call(calltab_t* tab, callable_obj_t * call, GtkTreeIter *paren break; case CALL_STATE_CURRENT: // If the call has been initiated by a another client and, when we start, it is already current - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); + if (dbus_get_is_recording(call)) + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/icon_rec.svg", NULL); + else + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); break; case CALL_STATE_HOLD: // If the call has been initiated by a another client and, when we start, it is already current pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/hold.svg", NULL); break; - case CALL_STATE_RECORD: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/icon_rec.svg", NULL); - break; case CALL_STATE_FAILURE: // If the call has been initiated by a another client and, when we start, it is already current pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/fail.svg", NULL); diff --git a/gnome/src/dbus/callmanager-introspec.xml b/gnome/src/dbus/callmanager-introspec.xml index a85e77732a1c548221b6d5d19eca3e0d06eb667a..07630ac456e632f1bc898bd6f8fb6a94bf714681 100644 --- a/gnome/src/dbus/callmanager-introspec.xml +++ b/gnome/src/dbus/callmanager-introspec.xml @@ -514,8 +514,7 @@ <li>BUSY</li> <li>FAILURE: Error when processing a call</li> <li>HOLD</li> - <li>UNHOLD_CURRENT</li> - <li>UNHOLD_RECORD</li> + <li>UNHOLD</li> </ul> </tp:docstring> </arg> diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c index 4d5a559cc0b4e9fd67d5b6ce5d607899785c6421..db58ab53708e2504a39931464637673b521dc156 100644 --- a/gnome/src/dbus/dbus.c +++ b/gnome/src/dbus/dbus.c @@ -203,19 +203,12 @@ process_existing_call_state_change(callable_obj_t *c, const gchar *state) calltree_update_call(history_tab, c); status_bar_display_account(); sflphone_hung_up(c); - } - else if (g_strcmp0(state, "UNHOLD_CURRENT") == 0) + } else if (g_strcmp0(state, "UNHOLD") == 0 || g_strcmp0(state, "CURRENT") == 0) sflphone_current(c); - else if (g_strcmp0(state, "UNHOLD_RECORD") == 0) - sflphone_record(c); else if (g_strcmp0(state, "HOLD") == 0) sflphone_hold(c); else if (g_strcmp0(state, "RINGING") == 0) sflphone_ringing(c); - else if (g_strcmp0(state, "CURRENT") == 0) - sflphone_current(c); - else if (g_strcmp0(state, "RECORD") == 0) - sflphone_record(c); else if (g_strcmp0(state, "FAILURE") == 0) sflphone_fail(c); else if (g_strcmp0(state, "BUSY") == 0) @@ -242,9 +235,7 @@ process_nonexisting_call_state_change(const gchar *callID, const gchar *state) // The callID is unknown, treat it like a new call // If it were an incoming call, we won't be here // It means that a new call has been initiated with an other client (cli for instance) - if (g_strcmp0(state, "RINGING") == 0 || - g_strcmp0(state, "CURRENT") == 0 || - g_strcmp0(state, "RECORD")) { + if (g_strcmp0(state, "RINGING") == 0 || g_strcmp0(state, "CURRENT") == 0) { DEBUG("New ringing call! accountID: %s", callID); @@ -344,7 +335,7 @@ conference_created_cb(DBusGProxy *proxy UNUSED, const gchar *confID, void *foo U im_widget_update_state(IM_WIDGET(call->_im_widget), FALSE); // if one of these participants is currently recording, the whole conference will be recorded - if (call->_state == CALL_STATE_RECORD) + if (dbus_get_is_recording(call)) new_conf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD; call->_historyConfID = g_strdup(confID); diff --git a/gnome/src/shortcuts.c b/gnome/src/shortcuts.c index b35333bcec4d894f8b244c17cffe9727a632122c..55d99f182b9952ff750ce9c70f5fad20c5c5614f 100644 --- a/gnome/src/shortcuts.c +++ b/gnome/src/shortcuts.c @@ -106,7 +106,6 @@ toggle_pick_up_hang_up_callback() case CALL_STATE_DIALING: case CALL_STATE_HOLD: case CALL_STATE_CURRENT: - case CALL_STATE_RECORD: case CALL_STATE_RINGING: sflphone_hang_up(); break; @@ -140,7 +139,6 @@ toggle_hold_callback() if (selectedCall) { switch (selectedCall->_state) { case CALL_STATE_CURRENT: - case CALL_STATE_RECORD: sflphone_on_hold(); break; case CALL_STATE_HOLD: diff --git a/gnome/src/uimanager.c b/gnome/src/uimanager.c index a75b85f8fa30840a5ba96b5f3879b4a193c9a61e..e47de8f00ee0093d7214f7db2e095a6f34f5b564 100644 --- a/gnome/src/uimanager.c +++ b/gnome/src/uimanager.c @@ -138,7 +138,8 @@ call_mute(void) static void -update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging_enabled) { +update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging_enabled) +{ int pos = 0; DEBUG("Update actions for call %s", selectedCall->_callID); @@ -238,39 +239,6 @@ update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging g_signal_handler_block(transferToolbar_, transferButtonConnId_); g_signal_handler_block(recordWidget_, recordButtonConnId_); - gtk_action_set_sensitive(hangUpAction_, TRUE); - gtk_action_set_sensitive(recordAction_, TRUE); - gtk_action_set_sensitive(muteAction_, TRUE); - gtk_widget_set_sensitive(holdMenu_, TRUE); - gtk_widget_set_sensitive(holdToolbar_, TRUE); - gtk_widget_set_sensitive(transferToolbar_, TRUE); - gtk_widget_set_sensitive(muteWidget_, TRUE); - if (instant_messaging_enabled) - gtk_action_set_sensitive(imAction_, TRUE); - - pos = 1; - add_to_toolbar(toolbar_, hangUpWidget_, pos++); - add_to_toolbar(toolbar_, holdToolbar_, pos++); - add_to_toolbar(toolbar_, transferToolbar_, pos++); - add_to_toolbar(toolbar_, recordWidget_, pos++); - add_to_toolbar(toolbar_, muteWidget_, pos++); - if (instant_messaging_enabled) { - add_to_toolbar(toolbar_, imToolbar_, pos++); - - gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), FALSE); - gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), FALSE); - - g_signal_handler_unblock(transferToolbar_, transferButtonConnId_); - g_signal_handler_unblock(recordWidget_, recordButtonConnId_); - break; - } - - case CALL_STATE_RECORD: - { - DEBUG("Call State Record"); - g_signal_handler_block(transferToolbar_, transferButtonConnId_); - g_signal_handler_block(recordWidget_, recordButtonConnId_); - gtk_action_set_sensitive(hangUpAction_, TRUE); gtk_action_set_sensitive(recordAction_, TRUE); gtk_action_set_sensitive(muteAction_, TRUE); @@ -291,12 +259,13 @@ update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging add_to_toolbar(toolbar_, imToolbar_, pos++); gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), FALSE); - gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), TRUE); + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), dbus_get_is_recording(selectedCall)); g_signal_handler_unblock(transferToolbar_, transferButtonConnId_); g_signal_handler_unblock(recordWidget_, recordButtonConnId_); break; } + case CALL_STATE_BUSY: case CALL_STATE_FAILURE: { @@ -328,7 +297,6 @@ update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging default: ERROR("Unknown state in action update!"); break; - } } } @@ -918,7 +886,6 @@ edit_paste(void * foo UNUSED) } break; case CALL_STATE_CURRENT: - case CALL_STATE_RECORD: default: { for (unsigned i = 0; i < strlen(no); i++) { gchar * oneNo = g_strndup(&no[i], 1); @@ -1318,7 +1285,6 @@ show_popup_menu(GtkWidget *my_widget, GdkEventButton *event) hangup = TRUE; accounts = TRUE; break; - case CALL_STATE_RECORD: case CALL_STATE_CURRENT: hangup = TRUE; hold = TRUE; diff --git a/gnome/src/widget/imwidget.c b/gnome/src/widget/imwidget.c index bf03d843106ceaa699ff2434c4fa23654bf39711..167156453d1be80e32c35bd8864176399bd0d54c 100644 --- a/gnome/src/widget/imwidget.c +++ b/gnome/src/widget/imwidget.c @@ -210,8 +210,7 @@ im_widget_send_message(const gchar *id, const gchar *message) dbus_send_text_message(id, message); else if (im_widget_call) { if (im_widget_call->_type == CALL && (im_widget_call->_state == CALL_STATE_CURRENT || - im_widget_call->_state == CALL_STATE_HOLD || - im_widget_call->_state == CALL_STATE_RECORD)) { + im_widget_call->_state == CALL_STATE_HOLD)) { /* Ship the message through D-Bus */ dbus_send_text_message(id, message); } else { @@ -326,7 +325,6 @@ call_state_image_widget(call_state_t state) switch (state) { case CALL_STATE_CURRENT: case CALL_STATE_HOLD: - case CALL_STATE_RECORD: return gtk_image_new_from_stock(GTK_STOCK_IM, GTK_ICON_SIZE_LARGE_TOOLBAR); default: return gtk_image_new_from_stock(GTK_STOCK_IM, GTK_ICON_SIZE_LARGE_TOOLBAR);