diff options
author | Peter Kozak <spag@golwen.net> | 2013-03-15 05:29:49 -0400 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-03-15 05:29:49 -0400 |
commit | 910fcee54d7ce3460815d4535556d497a343ea99 (patch) | |
tree | 956ec35c30d3a58dcca3b0758d2c1c3f546e54aa /app/models/sip_account.rb | |
parent | bac61b330fd9daa41eeba63f82790fba59c1f19d (diff) |
status fixed
Diffstat (limited to 'app/models/sip_account.rb')
-rw-r--r-- | app/models/sip_account.rb | 13 |
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 |