Jun
28
2012
0

Agent Auto log-off script for Asterisk

Many times an Agent will forget to logoff. This can cause call routing, payroll, and queue statistic problems with Asterisk. With a handy BASH script it is easy to log all the agents out the queues automatically. Below is the shell script and an example of the crontab entry for execution at 6:00 PM every day.

(more…)

Written by mattb in: Asterisk,Scripts | Tags: , , ,
Jul
03
2011
2

BASH script to logout Dynamic Agents

This is a simple script for logging out Dynamic Agents in Asterisk.  The most common use would be to logout Agents automatically each day in case they forget or are on PAUSE.  Edit the “LOGGEDIN” variable below to match the correct length of digits.  By default it is three,  ‘SIP/…’.

You can add as many or as few Queues in place of QUEUE1, QUEUE2, & QUEUE3.  This is the ‘foreach’ section of the script.  Whatever that is here will be applied to each instance of SIP/xxx detected by grep.  Good luck.

agent-auto-loggoff.script

————————————————————————–

#!/bin/bash

#set -x

# Execute from the command line, Asterisk or by cron

LOGGEDIN=$(/usr/sbin/asterisk -rx “queue show” | /bin/grep -o ‘SIP/…’)

for i in $LOGGEDIN

do

echo “$i removed”

#  Add in all queues that should be included
#==============

/usr/sbin/asterisk -rx “queue remove member $i from QUEUE1”
/usr/sbin/asterisk -rx “queue remove member $i from QUEUE2”
/usr/sbin/asterisk -rx “queue remove member $i from QUEUE3”

done

exit

Apr
22
2009
0

Asterisk: Creating an Extension to Logout Agents from CallerID

I told a customer for the company I for that I would figure out how to logout agents by CID(Caller ID). So I figured, why not kill two birds with one stone. Today we will create a single Queue, Agent, and dial plan to accomplish this goal. I’m using Asterisk 1.4, Fedora 10 and a Polycom IP SIP phone for my demonstration purposes.

When I started this project four hours ago, I thought I would google my way to another successful blog post(and happy customer), but no…  logging out agents in Asterisk is very unintuitive.  The agentcallbacklogin utility has the exact same prompts for logging in as out.  AgentCallbackLogin (when initiated, from the dial plan)  asks for three things, agent, agent password, and call back number.  To eliminate all these prompts I’m using the ‘$CallerID(num)’ variable to automatically answer the agent and call back number.  So the user 8888 dials ‘1000’ and and AgentCallbackLogin assumes he is AGENT/8888 with a password of ‘8888’.

from /etc/asterisk/extensions.conf

exten => 1000,1,AgentcallbackLogin(${CALLERID(num)}||${CALLERID(num)}@savelono-queue-out)
exten => 1000,n,hangup

(more…)

Apr
22
2009
1

queues.conf – agent logoff example

[general]

monitor-type=MixMonitor
eventmemberstatus=no
eventwhencalled=no

;[default]
;
; Default settings for queues (currently unused)
;

[savelono-support]

context = savelono-queue-out
musiconhold = default
strategy = leastrecent
timeout = 10
retry = 5
wrapuptime=20
announce-frequency = 90
announce-holdtime = no
announce-round-seconds = 30
queue-youarenext = queue-youarenext
queue-thereare = queue-thereare
queue-callswaiting = queue-callswaiting
queue-thankyou = queue-thankyou
monitor-format = wav
monitor-join = yes
joinempty = yes
eventmemberstatus=no
autofill=yes
;memberdelay = 1

member => Agent/8888

Apr
22
2009
1

agents.conf – agent logoff example

;
; Agent configuration
;
;
[agents]

autologoff=30
ackcall=no
wrapuptime=120
musiconhold => default
updatecdr=yes
createlink=yes
recordagentcalls=no

agent => 8888,8888,Lono

Written by mattb in: | Tags: , , ,