2016-04-29 22:21:39 +00:00
|
|
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
|
|
|
class CtiController < ApplicationController
|
|
|
|
before_action :authentication_check
|
|
|
|
|
|
|
|
# list current caller log
|
|
|
|
def index
|
2016-06-30 08:24:03 +00:00
|
|
|
deny_if_not_role('CTI')
|
2016-04-29 22:21:39 +00:00
|
|
|
|
|
|
|
backends = [
|
|
|
|
{
|
|
|
|
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
|
2016-06-30 08:24:03 +00:00
|
|
|
deny_if_not_role('CTI')
|
2016-04-29 22:21:39 +00:00
|
|
|
log = Cti::Log.find(params['id'])
|
|
|
|
log.done = params['done']
|
|
|
|
log.save
|
|
|
|
render json: {}
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|