diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-02-28 06:51:07 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-02-28 06:51:07 +0100 |
commit | 2b94b16ee1201d15b3b9d66e142df311141a47db (patch) | |
tree | 70ea5177c88e06ca4b8ae02ed2b9fc8685e73ffd /app/controllers/sip_accounts_controller.rb | |
parent | 5c87034a0448af2e2bd3f4de3bbaba4d482d1f7e (diff) | |
parent | e78e21860788ed7faabe25d645f58cd0c153dfac (diff) |
Merge branch 'develop'5.1.0
Diffstat (limited to 'app/controllers/sip_accounts_controller.rb')
-rw-r--r-- | app/controllers/sip_accounts_controller.rb | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/app/controllers/sip_accounts_controller.rb b/app/controllers/sip_accounts_controller.rb index 621bd3c..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 @@ -11,7 +10,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 @@ -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 => "<!-- CALL -->", - ) - return; - end - render( - :status => 404, - :layout => false, - :content_type => 'text/plain', - :text => "<!-- Number not found -->", - ) - return; - end - - render( - :status => 404, - :layout => false, - :content_type => 'text/plain', - :text => "<!-- Call URL not found -->", - ) - end - private def set_and_authorize_parent @parent = @user || @tenant |