diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-03-17 12:45:23 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-03-17 12:45:23 +0100 |
commit | d007b83d1d6b51caea93b5f08f449db88a930a16 (patch) | |
tree | 53c3ff07977cd374182358acef4b821a17e345b6 /app | |
parent | 0ed2894ca7371199788c202b61f53a3f73c4b03b (diff) | |
parent | abc16da2c2afa636a928a031a540e677f4ac84f8 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/call_routes_controller.rb | 23 | ||||
-rw-r--r-- | app/controllers/gemeinschaft_setups_controller.rb | 5 | ||||
-rw-r--r-- | app/models/sip_account.rb | 13 | ||||
-rw-r--r-- | app/views/softkeys/show.html.haml | 3 |
4 files changed, 36 insertions, 8 deletions
diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 50e7849..e5cf56a 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -88,10 +88,25 @@ class CallRoutesController < ApplicationController end def test - sip_account = SipAccount.where(:id => params[:sip_account_id]).first; - destination_number = params[:destination_number] - routing_table = params[:routing_table] - @route_test = CallRoute.test_route(routing_table, {'caller.destination_number' => destination_number, 'caller.auth_account_type' => 'SipAccount', 'caller.auth_account_uuid' => sip_account.uuid}) + if !params[:sip_account_id].blank? + account = SipAccount.where(:id => params[:sip_account_id]).first + elsif !params[:hunt_group_id].blank? + account = HuntGroup.where(:id => params[:hunt_group_id]).first + end + + if account + destination_number = params[:destination_number] + routing_table = params[:routing_table] + @route_test = CallRoute.test_route(routing_table, { + 'caller.destination_number' => destination_number, + 'caller.auth_account_type' => account.class.name, + 'caller.auth_account_id' => account.id, + 'caller.auth_account_uuid' => account.try(:uuid), + 'caller.account_type' => account.class.name, + 'caller.account_id' => account.id, + 'caller.account_uuid' => account.try(:uuid), + }) + end end private diff --git a/app/controllers/gemeinschaft_setups_controller.rb b/app/controllers/gemeinschaft_setups_controller.rb index a62df99..4949fa7 100644 --- a/app/controllers/gemeinschaft_setups_controller.rb +++ b/app/controllers/gemeinschaft_setups_controller.rb @@ -62,6 +62,11 @@ class GemeinschaftSetupsController < ApplicationController GsParameter.where(:name => 'ringtone_url').first.update_attributes(:value => "http://#{@gemeinschaft_setup.sip_domain.host}") GsParameter.where(:name => 'user_image_url').first.update_attributes(:value => "http://#{@gemeinschaft_setup.sip_domain.host}/uploads/user/image") + # Set ringback_tone + if @gemeinschaft_setup.country.country_code.to_s == '49' + GsParameter.where(:entity => 'dialplan', :section => 'variables', :name => 'ringback').first.update_attributes(:value => '%(1000,4000,425.0)') + end + # Restart FreeSWITCH if Rails.env.production? require 'freeswitch_event' diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb index 930069d..0c923be 100644 --- a/app/models/sip_account.rb +++ b/app/models/sip_account.rb @@ -188,25 +188,30 @@ class SipAccount < ActiveRecord::Base def status states = Array.new - SipAccount.last.call_legs.each do |call_leg| + self.call_legs.each do |call_leg| states << { - :status => call_leg.callstate, + :status => call_leg.b_callstate || call_leg.callstate, + :status_channel => call_leg.callstate, :caller => true, :endpoint_name => call_leg.callee_name, :endpoint_number => call_leg.destination, :endpoint_sip_account_id => call_leg.b_sip_account_id, :start_stamp => call_leg.start_stamp, + :secure => call_leg.secure, } end - SipAccount.last.b_call_legs.each do |call_leg| + self.b_call_legs.each do |call_leg| + call_status = states << { - :status => call_leg.callstate, + :status => call_leg.b_callstate, + :status_channel => call_leg.b_callstate, :caller => false, :endpoint_name => call_leg.caller_id_name, :endpoint_number => call_leg.caller_id_number, :endpoint_sip_account_id => call_leg.sip_account_id, :start_stamp => call_leg.start_stamp, + :secure => call_leg.b_secure, } end diff --git a/app/views/softkeys/show.html.haml b/app/views/softkeys/show.html.haml index 7c068ae..64adbe6 100644 --- a/app/views/softkeys/show.html.haml +++ b/app/views/softkeys/show.html.haml @@ -1,6 +1,9 @@ - content_for :title, t("softkeys.show.page_title") %p + %strong= t("softkeys.show.label") + ":" + =@softkey.label +%p %strong= t("softkeys.functions.#{@softkey.softkey_function}") + ":" =@softkey.to_s |