cti_controller.rb 681 B

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