cti_controller.rb 920 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. name: 'Placetel',
  19. enabled: Setting.get('placetel_integration'),
  20. url: '#system/integration/placetel',
  21. }
  22. ]
  23. result = Cti::Log.log
  24. result[:backends] = backends
  25. render json: result
  26. end
  27. # set caller log to done
  28. def done
  29. log = Cti::Log.find(params['id'])
  30. log.done = params['done']
  31. log.save!
  32. render json: {}
  33. end
  34. end