summaryrefslogtreecommitdiff
path: root/app/models/automatic_call_distributor.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:01:45 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:01:45 +0100
commitb80bd744ad873f6fc43018bc4bfb90677de167bd (patch)
tree072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/models/automatic_call_distributor.rb
parent3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff)
Start of GS5.
Diffstat (limited to 'app/models/automatic_call_distributor.rb')
-rw-r--r--app/models/automatic_call_distributor.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/models/automatic_call_distributor.rb b/app/models/automatic_call_distributor.rb
new file mode 100644
index 0000000..678e0eb
--- /dev/null
+++ b/app/models/automatic_call_distributor.rb
@@ -0,0 +1,21 @@
+class AutomaticCallDistributor < ActiveRecord::Base
+ attr_accessible :uuid, :name, :strategy, :automatic_call_distributorable_type, :automatic_call_distributorable_id, :max_callers, :agent_timeout, :retry_timeout, :join, :leave, :gs_node_id, :announce_position, :announce_call_agents, :greeting, :goodbye, :music
+
+ belongs_to :automatic_call_distributorable, :polymorphic => true
+
+ has_many :acd_agents, :dependent => :destroy
+ has_many :phone_numbers, :as => :phone_numberable, :dependent => :destroy
+ accepts_nested_attributes_for :phone_numbers,
+ :reject_if => lambda { |phone_number| phone_number[:number].blank? },
+ :allow_destroy => true
+
+ validates_presence_of :strategy
+
+ STRATEGIES = ['ring_all', 'round_robin']
+ JOIN_ON = ['agents_available', 'agents_active', 'always']
+ LEAVE_ON = ['no_agents_available_timeout', 'no_agents_active_timeout', 'no_agents_available', 'no_agents_active', 'timeout', 'never']
+
+ def to_s
+ self.name
+ end
+end