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.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index 8459265..d35f9b4 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -10,7 +10,7 @@ class SipAccount < ActiveRecord::Base
# Associations:
#
- belongs_to :sip_accountable, :polymorphic => true
+ belongs_to :sip_accountable, :polymorphic => true, :touch => true
has_many :phone_sip_accounts, :uniq => true
has_many :phones, :through => :phone_sip_accounts
@@ -71,7 +71,7 @@ class SipAccount < ActiveRecord::Base
after_update :log_out_phone_if_not_local
def to_s
- truncate((self.caller_name || "SipAccount ID #{self.id}"), :length => TO_S_MAX_CALLER_NAME_LENGTH) + " (#{truncate(self.auth_name, :length => TO_S_MAX_LENGTH_OF_AUTH_NAME)}@...#{self.host.split(/\./)[2,3].to_a.join('.') if self.host })"
+ truncate((self.caller_name || "SipAccount ID #{self.id}"), :length => GsParameter.get('TO_S_MAX_CALLER_NAME_LENGTH')) + " (#{truncate(self.auth_name, :length => GsParameter.get('TO_S_MAX_LENGTH_OF_AUTH_NAME'))}@...#{self.host.split(/\./)[2,3].to_a.join('.') if self.host })"
end
def call_forwarding_toggle( call_forwarding_service, to_voicemail = nil )
@@ -200,7 +200,7 @@ class SipAccount < ActiveRecord::Base
# log out phone if sip_account is not on this node
def log_out_phone_if_not_local
- if self.gs_node_id && ! GsNode.where(:ip_address => HOMEBASE_IP_ADDRESS, :id => self.gs_node_id).first
+ if self.gs_node_id && ! GsNode.where(:ip_address => GsParameter.get('HOMEBASE_IP_ADDRESS'), :id => self.gs_node_id).first
self.phones.each do |phone|
phone.user_logout;
end