cti_controller.rb 778 B

12345678910111213141516171819202122232425262728293031323334
  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: 'CTI (generic)',
  9. enabled: Setting.get('cti_integration'),
  10. url: '#system/integration/cti',
  11. },
  12. {
  13. name: 'sipgate.io',
  14. enabled: Setting.get('sipgate_integration'),
  15. url: '#system/integration/sipgate',
  16. }
  17. ]
  18. result = Cti::Log.log
  19. result[:backends] = backends
  20. render json: result
  21. end
  22. # set caller log to done
  23. def done
  24. log = Cti::Log.find(params['id'])
  25. log.done = params['done']
  26. log.save!
  27. render json: {}
  28. end
  29. end