summaryrefslogtreecommitdiff
path: root/app/models/sip_account.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-05 23:01:16 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-05 23:01:16 +0100
commitddb3dfa92ec0878240211cb2b7a8e125961b1360 (patch)
tree0111ac9f589d97503046d9a81cd3af841e17501d /app/models/sip_account.rb
parente76890d5f4634d47514a592d501d9792ae2ff7bb (diff)
Moved to GsParemeter.get and set defaults for a couple of validations.
Diffstat (limited to 'app/models/sip_account.rb')
-rw-r--r--app/models/sip_account.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index 8459265..5388395 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -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