summaryrefslogtreecommitdiff
path: root/app/models/sip_account.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-17 12:45:23 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-17 12:45:23 +0100
commitd007b83d1d6b51caea93b5f08f449db88a930a16 (patch)
tree53c3ff07977cd374182358acef4b821a17e345b6 /app/models/sip_account.rb
parent0ed2894ca7371199788c202b61f53a3f73c4b03b (diff)
parentabc16da2c2afa636a928a031a540e677f4ac84f8 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/models/sip_account.rb')
-rw-r--r--app/models/sip_account.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index 930069d..0c923be 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -188,25 +188,30 @@ class SipAccount < ActiveRecord::Base
def status
states = Array.new
- SipAccount.last.call_legs.each do |call_leg|
+ self.call_legs.each do |call_leg|
states << {
- :status => call_leg.callstate,
+ :status => call_leg.b_callstate || call_leg.callstate,
+ :status_channel => call_leg.callstate,
:caller => true,
:endpoint_name => call_leg.callee_name,
:endpoint_number => call_leg.destination,
:endpoint_sip_account_id => call_leg.b_sip_account_id,
:start_stamp => call_leg.start_stamp,
+ :secure => call_leg.secure,
}
end
- SipAccount.last.b_call_legs.each do |call_leg|
+ self.b_call_legs.each do |call_leg|
+ call_status =
states << {
- :status => call_leg.callstate,
+ :status => call_leg.b_callstate,
+ :status_channel => call_leg.b_callstate,
:caller => false,
:endpoint_name => call_leg.caller_id_name,
:endpoint_number => call_leg.caller_id_number,
:endpoint_sip_account_id => call_leg.sip_account_id,
:start_stamp => call_leg.start_stamp,
+ :secure => call_leg.b_secure,
}
end