summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-05-07 12:58:07 +0200
committerPeter Kozak <spag@golwen.net>2013-05-07 12:58:07 +0200
commitf96ae5aa5b18b1a8b5359853e38ee3ae2b2e6028 (patch)
tree40996d54556262e225da06db758bf4d02f87415a /app
parentc5bfe11c01f2b3575ec96b6bd6f567976d93ff63 (diff)
support for additional provisioning parameters
Diffstat (limited to 'app')
-rw-r--r--app/controllers/config_siemens_controller.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/config_siemens_controller.rb b/app/controllers/config_siemens_controller.rb
index 7d5eb3f..3fe3aaa 100644
--- a/app/controllers/config_siemens_controller.rb
+++ b/app/controllers/config_siemens_controller.rb
@@ -194,6 +194,18 @@ class ConfigSiemensController < ApplicationController
#logger.debug(@phone_items)
@my_nonce = params[:WorkpointMessage][:Message][:nonce]
@new_settings = Array.new
+
+ phone_parameters = GsParameter.get_list('phones', 'siemens')
+ phone_parameters.each do |name, value|
+ value = value.gsub!(/\{([a-z0-9_\.]+)\}/) { |v|
+ source = @sip_account
+ $1.split('.').each do |method|
+ source = source.send(method) if source.respond_to?(method)
+ end
+ source.to_s
+ }
+ @new_settings << [name, nil, value]
+ end
@new_settings << ['dhcp', nil, 'true']
@new_settings << ['hostname', nil, mac_address.gsub(':', '') ]
@@ -479,7 +491,6 @@ class ConfigSiemensController < ApplicationController
@new_settings << ['feature-availability', 33, 'true'] # line overview
@new_settings << ['feature-availability', 33, 'false'] # phone lock
-
@soft_keys = Array.new
# Fill softkeys with keys dependent on limit of phone
@sip_account.softkeys.order(:position).each do |sk|