summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-02-13 08:48:01 +0100
committerspag <spag@golwen.net>2013-02-13 08:48:01 +0100
commit363963698b42ea19c1b7e30e2e04cdb5717b5d5a (patch)
treea126131103af55b4e06bc551b19322b58eb00831
parent1b9b5327df5a81957b2042869213bb464c6e03ca (diff)
parking_stall softkey function
-rw-r--r--app/controllers/config_snom_controller.rb47
1 files changed, 25 insertions, 22 deletions
diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb
index 58cced2..d36f990 100644
--- a/app/controllers/config_snom_controller.rb
+++ b/app/controllers/config_snom_controller.rb
@@ -282,28 +282,31 @@ class ConfigSnomController < ApplicationController
@softkeys.push({:context => sip_account_index, :label => softkey.label, :data => "speed f-li-#{softkey.number}"})
when 'conference'
@softkeys.push({:context => sip_account_index, :label => softkey.label, :data => "blf <sip:#{softkey.number}@#{sip_account.host}>|f-ta-"})
- when 'call_parking'
- @softkeys.push({
- :context => sip_account_index,
- :function => softkey.softkey_function.name,
- :label => softkey.label,
- :softkey => softkey,
- :general_type => t("softkeys.functions.#{softkey.softkey_function.name}"),
- :subscription => {
- :to => "park+#{@softkeys.softkeyable_id}@#{sip_account.host}",
- :for => "#{sip_account.auth_name}@#{sip_account.host}"
- },
- :actions => [{
- :type => :dial,
- :target => "f-tpark-#{@softkeys.softkeyable_id}",
- :when => 'on press',
- :states => 'connected,holding',
- },{
- :type => :dial,
- :target => "f-park-#{@softkeys.softkeyable_id}",
- :when => 'on press',
- }],
- })
+ when 'parking_stall'
+ parking_stall = softkey.softkeyable
+ if parking_stall.class == ParkingStall
+ @softkeys.push({
+ :context => sip_account_index,
+ :function => softkey.softkey_function.name,
+ :label => softkey.label,
+ :softkey => softkey,
+ :general_type => t("softkeys.functions.#{softkey.softkey_function.name}"),
+ :subscription => {
+ :to => "park+#{parking_stall.name}@#{sip_account.host}",
+ :for => "#{sip_account.auth_name}@#{sip_account.host}"
+ },
+ :actions => [{
+ :type => :dial,
+ :target => "f-cpa-#{parking_stall.name}",
+ :when => 'on press',
+ :states => 'connected,holding',
+ },{
+ :type => :dial,
+ :target => "f-cpa-#{parking_stall.name}",
+ :when => 'on press',
+ }],
+ })
+ end
when 'call_forwarding'
if softkey.softkeyable.class == CallForward then
@softkeys.push({