callable_obj_t * sflphone_new_call(SFLPhoneClient *client) { // Disable screensaver if the list is empty call guint nbcall = calllist_get_size(current_calls_tab); if(nbcall == 0) dbus_screensaver_inhibit(); callable_obj_t *selected_call = calllist_empty(current_calls_tab) ? NULL : calltab_get_selected_call(current_calls_tab); if (selected_call != NULL && selected_call->_callID) { gchar *confID = dbus_get_conference_id(selected_call->_callID); if (g_strcmp0(confID, "") != 0) sflphone_on_hold(); g_free(confID); } // Play a tone when creating a new call if (calllist_empty(current_calls_tab)) dbus_start_tone(TRUE , (current_account_has_new_message() > 0) ? TONE_WITH_MESSAGE : TONE_WITHOUT_MESSAGE) ; callable_obj_t *c = create_new_call(CALL, CALL_STATE_DIALING, "", "", "", ""); c->_history_state = g_strdup(OUTGOING_STRING); calllist_add_call(current_calls_tab, c); calltree_add_call(current_calls_tab, c, NULL); update_actions(client); return c; }
/* Returns false when fallback should be attempted */ bool dbus_suspend_screensaver(bool enable) { #ifdef HAVE_DBUS if (enable) return dbus_screensaver_inhibit(); dbus_screensaver_uninhibit(); #endif return false; }
void sflphone_pick_up(SFLPhoneClient *client) { callable_obj_t *selectedCall = calltab_get_selected_call(active_calltree_tab); // Disable screensaver if the list is empty call if (calllist_get_size(current_calls_tab) == 0) dbus_screensaver_inhibit(); if (!selectedCall) { sflphone_new_call(client); return; } switch (selectedCall->_state) { case CALL_STATE_DIALING: sflphone_place_call(selectedCall, client); break; case CALL_STATE_INCOMING: selectedCall->_history_state = g_strdup(INCOMING_STRING); calltree_update_call(history_tab, selectedCall, client); dbus_accept(selectedCall); break; case CALL_STATE_TRANSFER: dbus_transfer(selectedCall); break; case CALL_STATE_CURRENT: case CALL_STATE_HOLD: case CALL_STATE_RINGING: sflphone_new_call(client); break; default: g_warning("Should not happen in sflphone_pick_up()!"); break; } }