cti_controller.rb 640 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
  2. class CtiController < ApplicationController
  3. prepend_before_action { authentication_check(permission: 'cti.agent') }
  4. # list current caller log
  5. def index
  6. backends = [
  7. {
  8. name: 'sipgate.io',
  9. enabled: Setting.get('sipgate_integration'),
  10. url: '#system/integration/sipgate',
  11. }
  12. ]
  13. result = Cti::Log.log
  14. result[:backends] = backends
  15. render json: result
  16. end
  17. # set caller log to done
  18. def done
  19. log = Cti::Log.find(params['id'])
  20. log.done = params['done']
  21. log.save
  22. render json: {}
  23. end
  24. end