trabajo-afectivo/app/controllers/cti_controller.rb

40 lines
941 B
Ruby
Raw Normal View History

2016-10-19 03:11:36 +00:00
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
class CtiController < ApplicationController
prepend_before_action { authentication_check(permission: 'cti.agent') }
# list current caller log
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',
2018-10-15 09:47:59 +00:00
},
{
name: 'Placetel',
2018-10-15 09:47:59 +00:00
enabled: Setting.get('placetel_integration'),
url: '#system/integration/placetel',
}
]
result = Cti::Log.log
result[:backends] = backends
render json: result
end
# set caller log to done
def done
log = Cti::Log.find(params['id'])
log.done = params['done']
2017-10-02 10:31:59 +00:00
log.save!
render json: {}
end
end