Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Please adapt these three settings to your environment:
* `domain` in `backends.py` should be the domain part of the queues/agents you want to display
* `URI` in `queuemon.py` to access `mod_xml_rpc`
* `hide_agents` can contain agents that should never be shown
* `hide_queues` can contain queues that should never be shown and it's agent too

## ToDo

Expand Down
13 changes: 13 additions & 0 deletions queuemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@
from time import strftime
from datetime import datetime
import time
import re
from backends import CallcenterStatusBackend

app = Flask(__name__)

backend = CallcenterStatusBackend

hide_queues = (
'[email protected]',
)

hide_agents = (
'[email protected]',
)
Expand Down Expand Up @@ -88,6 +93,11 @@ def status():
def status_content():
fs = backend(URI)
agents = fs.get_agents()
for b in hide_queues:
b = re.sub('^.*@',"", b)
for a in agents.keys():
if b in a:
del agents[a]
for a in agents.keys():
if a in hide_agents:
del agents[a]
Expand All @@ -96,6 +106,9 @@ def status_content():
'free': len([a['name'] for a in agents.itervalues() if a['status'] != 'Logged Out' and a.get('callstate') is None])
}
queues = fs.get_queues()
for a in queues.keys():
if a in hide_queues:
del queues[a]
clock = strftime('%H:%M') if request.args.get('showclock') and request.args['showclock'] != 0 else None
return render_template('status_content.html', agents=agents, agent_stats=agent_stats, queues=queues, clock=clock)

Expand Down