summaryrefslogtreecommitdiff
path: root/app/controllers/sip_accounts_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/sip_accounts_controller.rb')
-rw-r--r--app/controllers/sip_accounts_controller.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/controllers/sip_accounts_controller.rb b/app/controllers/sip_accounts_controller.rb
index 8292a74..4d042b3 100644
--- a/app/controllers/sip_accounts_controller.rb
+++ b/app/controllers/sip_accounts_controller.rb
@@ -15,11 +15,11 @@ class SipAccountsController < ApplicationController
def new
@sip_account = @parent.sip_accounts.build
@sip_account.caller_name = @parent
- @sip_account.call_waiting = CALL_WAITING
- @sip_account.clir = DEFAULT_CLIR_SETTING
- @sip_account.clip = DEFAULT_CLIP_SETTING
+ @sip_account.call_waiting = GsParameter.get('CALL_WAITING')
+ @sip_account.clir = GsParameter.get('DEFAULT_CLIR_SETTING')
+ @sip_account.clip = GsParameter.get('DEFAULT_CLIP_SETTING')
@sip_account.voicemail_pin = random_pin
- @sip_account.callforward_rules_act_per_sip_account = CALLFORWARD_RULES_ACT_PER_SIP_ACCOUNT_DEFAULT
+ @sip_account.callforward_rules_act_per_sip_account = GsParameter.get('CALLFORWARD_RULES_ACT_PER_SIP_ACCOUNT_DEFAULT')
if @parent.class == User
@sip_account.hotdeskable = true
end
@@ -27,11 +27,11 @@ class SipAccountsController < ApplicationController
# Make sure that we don't use an already taken auth_name
#
loop do
- @sip_account.auth_name = SecureRandom.hex(DEFAULT_LENGTH_SIP_AUTH_NAME)
+ @sip_account.auth_name = SecureRandom.hex(GsParameter.get('DEFAULT_LENGTH_SIP_AUTH_NAME'))
break unless SipAccount.exists?(:auth_name => @sip_account.auth_name)
end
- @sip_account.password = SecureRandom.hex(DEFAULT_LENGTH_SIP_PASSWORD)
+ @sip_account.password = SecureRandom.hex(GsParameter.get('DEFAULT_LENGTH_SIP_PASSWORD'))
end
def create
@@ -39,13 +39,13 @@ class SipAccountsController < ApplicationController
if @sip_account.auth_name.blank?
loop do
- @sip_account.auth_name = SecureRandom.hex(DEFAULT_LENGTH_SIP_AUTH_NAME)
+ @sip_account.auth_name = SecureRandom.hex(GsParameter.get('DEFAULT_LENGTH_SIP_AUTH_NAME'))
break unless SipAccount.exists?(:auth_name => @sip_account.auth_name)
end
end
if @sip_account.password.blank?
- @sip_account.password = SecureRandom.hex(DEFAULT_LENGTH_SIP_PASSWORD)
+ @sip_account.password = SecureRandom.hex(GsParameter.get('DEFAULT_LENGTH_SIP_PASSWORD'))
end
if @sip_account.save