2016-10-19 03:11:36 +00:00
|
|
|
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
2016-04-29 22:21:39 +00:00
|
|
|
|
|
|
|
class CtiController < ApplicationController
|
2017-02-15 12:29:25 +00:00
|
|
|
prepend_before_action { authentication_check(permission: 'cti.agent') }
|
2016-04-29 22:21:39 +00:00
|
|
|
|
|
|
|
# list current caller log
|
|
|
|
def index
|
|
|
|
backends = [
|
2018-05-28 23:45:29 +00:00
|
|
|
{
|
|
|
|
name: 'CTI (generic)',
|
|
|
|
enabled: Setting.get('cti_integration'),
|
|
|
|
url: '#system/integration/cti',
|
|
|
|
},
|
2016-04-29 22:21:39 +00:00
|
|
|
{
|
|
|
|
name: 'sipgate.io',
|
|
|
|
enabled: Setting.get('sipgate_integration'),
|
|
|
|
url: '#system/integration/sipgate',
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
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!
|
2016-04-29 22:21:39 +00:00
|
|
|
render json: {}
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|