From 477fcf8bce7dff84bb11fa79a4ad4f106d1ec8ad Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 27 Feb 2013 16:57:44 -0500 Subject: use call model for tel: url binding --- app/controllers/sip_accounts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/sip_accounts_controller.rb b/app/controllers/sip_accounts_controller.rb index 621bd3c..27d464f 100644 --- a/app/controllers/sip_accounts_controller.rb +++ b/app/controllers/sip_accounts_controller.rb @@ -11,7 +11,7 @@ class SipAccountsController < ApplicationController end def show - @register_tel_protocol = "#{request.protocol}#{request.host_with_port}/sip_accounts/#{@sip_account.try(:id)}/call?url=%s" + @register_tel_protocol = "#{request.protocol}#{request.host_with_port}/sip_accounts/#{@sip_account.try(:id)}/calls/new?url=%s" end def new -- cgit v1.2.3 From 144a26c3e33dd0072d269b7d8df18268de3c1a04 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 27 Feb 2013 17:02:27 -0500 Subject: custom action call removed --- app/controllers/sip_accounts_controller.rb | 31 ------------------------------ config/routes.rb | 3 --- 2 files changed, 34 deletions(-) diff --git a/app/controllers/sip_accounts_controller.rb b/app/controllers/sip_accounts_controller.rb index 27d464f..b34172d 100644 --- a/app/controllers/sip_accounts_controller.rb +++ b/app/controllers/sip_accounts_controller.rb @@ -1,7 +1,6 @@ class SipAccountsController < ApplicationController load_resource :user load_resource :tenant - load_and_authorize_resource :sip_account, :only => [:call] load_and_authorize_resource :sip_account, :through => [:user, :tenant ] before_filter :set_and_authorize_parent @@ -76,36 +75,6 @@ class SipAccountsController < ApplicationController redirect_to :root, :notice => t('sip_accounts.controller.successfuly_destroyed') end - def call - if !params[:url].blank? - protocol, separator, phone_number = params[:url].partition(':') - if ! phone_number.blank? - @sip_account.call(phone_number) - render( - :status => 200, - :layout => false, - :content_type => 'text/plain', - :text => "", - ) - return; - end - render( - :status => 404, - :layout => false, - :content_type => 'text/plain', - :text => "", - ) - return; - end - - render( - :status => 404, - :layout => false, - :content_type => 'text/plain', - :text => "", - ) - end - private def set_and_authorize_parent @parent = @user || @tenant diff --git a/config/routes.rb b/config/routes.rb index 2fe1682..83ac5c4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -277,9 +277,6 @@ Gemeinschaft42c::Application.routes.draw do end end resources :voicemail_settings - member do - get 'call' - end end resources :phones, :only => [] do -- cgit v1.2.3 From 7b6c969acf68fa4cdb3b77559ff8af0eef8e5b1d Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 27 Feb 2013 17:46:55 -0500 Subject: call ability removed --- app/models/ability.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 3ba4481..48cce84 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -131,7 +131,7 @@ class Ability # SipAccounts and Phones # - can [:read, :call], SipAccount, :sip_accountable_type => 'User', :sip_accountable_id => user.id + can :read, SipAccount, :sip_accountable_type => 'User', :sip_accountable_id => user.id user.sip_accounts.each do |sip_account| can :read, PhoneNumber, :id => sip_account.phone_number_ids can :manage, CallForward, :call_forwardable_id => sip_account.phone_number_ids -- cgit v1.2.3 From e78e21860788ed7faabe25d645f58cd0c153dfac Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 27 Feb 2013 17:47:13 -0500 Subject: fixed call authentication --- misc/freeswitch/scripts/dialplan/dialplan.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/freeswitch/scripts/dialplan/dialplan.lua b/misc/freeswitch/scripts/dialplan/dialplan.lua index 7d9ac58..4425f8b 100644 --- a/misc/freeswitch/scripts/dialplan/dialplan.lua +++ b/misc/freeswitch/scripts/dialplan/dialplan.lua @@ -251,7 +251,7 @@ function Dialplan.retrieve_caller_data(self) -- TODO: Set auth_account on transfer initiated by calling party if not common.str.blank(self.caller.dialed_sip_user) then - self.caller.auth_account = self:object_find('sipaccount', self.caller.dialed_domain, dialed_sip_user); + self.caller.auth_account = self:object_find('sipaccount', self.caller.dialed_domain, self.caller.dialed_sip_user); if self.caller.set_auth_account then self.caller:set_auth_account(self.caller.auth_account); end -- cgit v1.2.3