Skip to content

Commit d2085a9

Browse files
committed
fixed view problems
1 parent 594af29 commit d2085a9

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

app.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Ramaze.setup do |g|
55
gem 'bacon', '1.1.0'
66
gem 'eventmachine', '0.12.10'
7-
gem 'freeswitcher', '0.6.0', lib: 'fsr'
7+
gem 'freeswitcher', '0.6.12', lib: 'fsr'
88
gem 'log4r', '1.1.9'
99
gem 'name_parse', '0.0.5'
1010
gem 'pg', '0.10.1'

bin/dialer

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ require "fsr/command_socket"
1111
FSR.load_all_commands
1212
require "tiny_dialer/tcc_helper"
1313
TinyDialer::Log.level = Log4r.const_get(TinyDialer.options.dialer.log_level)
14+
1415
module TinyDialer
1516
class DialManager
1617
attr_reader :hopper, :host, :pass, :max_dials
@@ -43,7 +44,7 @@ module TinyDialer
4344

4445
def ready_agents
4546
agents = if TinyDialer.options.direct_listener.tcc_root
46-
TCC_Helper.ready_agents.size
47+
TCC_Helper.ready_agents(TinyDialer.options.dialer.transfer_queue).size
4748
else
4849
if row = TinyDialer.db[:dialer_pool].first
4950
row[:dialer_max]

controller/admin.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def stats
4949
return {
5050
ratio: ratio,
5151
aim: aim,
52+
queue: queue,
5253
current_dials: current_dials,
5354
dialer_status: dialer_status,
5455
ivr_status: ivr_status,
@@ -59,11 +60,12 @@ def stats
5960
private
6061

6162
def dialer_status
62-
dialer_status = `sv stat #{ENV['HOME']}/service/#{ENV['APP_DB']} 2>/dev/null`.split(':')[0]
63+
Ramaze::Log.info cmd = "sv stat #{ENV['HOME']}/service/#{ENV['APP_DB']} 2>/dev/null"
64+
dialer_status = `#{cmd}`.split(':')[0]
6365
end
6466

6567
def ivr_status
66-
ivr_status = `sv stat #{ENV['HOME']}/service/ivr 2>/dev/null`.split(':')[0]
68+
ivr_status = `sv stat #{ENV['HOME']}/service/td_direct_listener 2>/dev/null`.split(':')[0]
6769
end
6870
end
6971
end

lib/tiny_dialer/tcc_helper.rb

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ module TinyDialer
22
module TCC_Helper
33
def self.ready_agents(queue = nil)
44
reg_servers = {}
5-
all_agents = agents
5+
66
if queue
77
members = Hash[tier_members(queue).map { |t| [t.agent, t.state] }]
8-
our_agents = all_agents.select { |a| members.key?(a.name) }
8+
our_agents = agents.select { |a| members.key?(a.name) }
99
else
10-
our_agents = all_agents
10+
our_agents = agents
11+
members = Hash[our_agents.map { |t| [t.agent, t.state] }]
1112
end
1213

14+
# TinyDialer::Log.info "Our agents: #{our_agents.inspect}"
15+
1316
our_agents.each { |n|
1417
n.ext = TinyCallCenter::Account.extension(n.name)
1518
n.reg_server = TinyCallCenter::Account.registration_server(n.ext)
@@ -20,10 +23,10 @@ def self.ready_agents(queue = nil)
2023
next unless agent.status =~ /Available/ # only select Available
2124
next unless members[agent.name] =~ /Ready/
2225
channels = reg_servers[agent.reg_server]
23-
channels.select{|channel|
26+
channels.any?{|channel|
2427
next if channel.dest == '19999' # ignore calls with dest
2528
channel.dest == agent.ext || channel.name =~ /(?:^|\/)(?:sip:)?#{agent.ext}[@-]/
26-
}.empty?
29+
}
2730
}
2831
end
2932

options.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module TinyDialer
3434
o "Freeswitch Server Password",
3535
:fs_auth, ENV['TD_FS_SERVER_AUTH'] || 'ClueCon'
3636
o "Log Level (DEBUG, INFO, WARN, ERROR, CRIT)",
37-
:log_level, ENV['TD_LOG_LEVEL'] || 'INFO'
37+
:log_level, ENV['TD_LOG_LEVEL'] || 'DEBUG'
3838
end
3939
end
4040
end

view/index.xhtml

+2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
<th>Aim</th>
88
<th>Dialer Status</th>
99
<th>IVR Listener</th>
10+
<th>Transfer Queue</th>
1011
</tr>
1112
<tr>
1213
<td id="show_current_dials"></td>
1314
<td id="show_ready_agents"></td>
1415
<td id="show_aim"></td>
1516
<td id="show_dialer_status"></td>
1617
<td id="show_ivr_status"></td>
18+
<td id="show_queue"></td>
1719
</tr>
1820
</table>
1921

0 commit comments

Comments
 (0)