summaryrefslogtreecommitdiff
path: root/app/models/sip_account.rb
diff options
context:
space:
mode:
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 cea5f0e..50124e9 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