123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- class CtiController < ApplicationController
- prepend_before_action :authenticate_and_authorize!
-
-
- def index
- backends = [
- {
- name: __('CTI (generic)'),
- enabled: Setting.get('cti_integration'),
- url: '#system/integration/cti',
- },
- {
- name: 'sipgate.io',
- enabled: Setting.get('sipgate_integration'),
- url: '#system/integration/sipgate',
- },
- {
- name: __('Placetel'),
- enabled: Setting.get('placetel_integration'),
- url: '#system/integration/placetel',
- }
- ]
- result = Cti::Log.log(current_user)
- result[:backends] = backends
- render json: result
- end
-
-
- def done
- log = Cti::Log.find(params['id'])
- log.done = params['done']
- log.save!
- render json: {}
- end
-
-
- def done_bulk
- log_ids = params['ids'] || []
- log_ids.each do |log_id|
- log = Cti::Log.find(log_id)
- log.done = true
- log.save!
- end
- render json: {}
- end
- end
|