summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-27 10:32:34 +0100
committerPeter Kozak <spag@golwen.net>2013-03-27 10:32:34 +0100
commitb9e37bcb2ba1d54ab32dc1185266d7ffa0a0c3b9 (patch)
tree30e47543d3011040139002fa9e3867338ea4a2f1
parenta634e8b158dac11250181d7cae35a08afbea96d4 (diff)
inherit voicemail_account and language_code
-rw-r--r--app/controllers/sip_accounts_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/sip_accounts_controller.rb b/app/controllers/sip_accounts_controller.rb
index 8208a29..7bb2689 100644
--- a/app/controllers/sip_accounts_controller.rb
+++ b/app/controllers/sip_accounts_controller.rb
@@ -22,7 +22,6 @@ class SipAccountsController < ApplicationController
@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 = GsParameter.get('CALLFORWARD_RULES_ACT_PER_SIP_ACCOUNT_DEFAULT')
if @parent.class == User
@sip_account.hotdeskable = true
@@ -36,6 +35,9 @@ class SipAccountsController < ApplicationController
break unless SipAccount.exists?(:auth_name => @sip_account.auth_name)
end
@sip_account.password = SecureRandom.hex(GsParameter.get('DEFAULT_LENGTH_SIP_PASSWORD'))
+
+ @sip_account.voicemail_account = VoicemailAccount.where(:voicemail_accountable_type => @parent.class.name, :voicemail_accountable_id => @parent.id).first
+ @sip_account.language_code = @parent.language.try(:code)
possible_voicemail_accounts
end