From 363963698b42ea19c1b7e30e2e04cdb5717b5d5a Mon Sep 17 00:00:00 2001 From: spag Date: Wed, 13 Feb 2013 08:48:01 +0100 Subject: parking_stall softkey function --- app/controllers/config_snom_controller.rb | 47 ++++++++++++++++--------------- 1 file changed, 25 insertions(+), 22 deletions(-) (limited to 'app/controllers/config_snom_controller.rb') 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 |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({ -- cgit v1.2.3 From 124a421b19e08447fa790b65cc969dadd7408539 Mon Sep 17 00:00:00 2001 From: spag Date: Thu, 14 Feb 2013 14:46:35 +0100 Subject: fixed subscriptions on newer phone firmware versions --- app/controllers/config_snom_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/controllers/config_snom_controller.rb') diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb index d36f990..76fa633 100644 --- a/app/controllers/config_snom_controller.rb +++ b/app/controllers/config_snom_controller.rb @@ -292,8 +292,8 @@ class ConfigSnomController < ApplicationController :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}" + :to => "sip:park+#{parking_stall.name}@#{sip_account.host}", + :for => "sip:park+#{parking_stall.name}@#{sip_account.host}", }, :actions => [{ :type => :dial, @@ -316,8 +316,8 @@ class ConfigSnomController < ApplicationController :softkey => softkey, :general_type => t("softkeys.functions.#{softkey.softkey_function.name}"), :subscription => { - :to => "f-cftg-#{softkey.softkeyable_id}@#{sip_account.host}", - :for => "#{sip_account.auth_name}@#{sip_account.host}" + :to => "sip:f-cftg-#{softkey.softkeyable_id}@#{sip_account.host}", + :for => "sip:f-cftg-#{softkey.softkeyable_id}@#{sip_account.host}" }, :actions => [{ :type => :url, -- cgit v1.2.3