Using a HT-488 with Asterisk
The Grandstream HandyTone HT-488 is a low-cost SIP analog adapter that offers one FXS port and one FXO port to connect one analog telephone and one POTS line to the unit. The scenario We want to install the unit with an Asterisk server whick IP is 10.10.3.5 and want to register the telephone attached to the unit as SIP/32, while the FXO line will be seen by Asterisk as SIP/33. Installing the HT-488 As it ships, access for the web interface is disabled for users accessing from the WAN. To enable it, connect the LAN port of the unit to a PC with a cross-cable patch, use the unit’s own DHCP server to assign address to the PC and logon by navigating to http://192.168.2.1 (password admin ) - go to Basic settings and set WAN side http access. Save and reboot. Connect the unit to your LAN through the WAN port and connect to it through its DHCP-assigned address (to see what that is, connect a phone to the FXS port and digit **02** to have the unit read out the assigned IP address). If the unit did not get an IP address, select the option **01** and then 9 to switch from fixed-ip to DHCP mode. Firmware upgrade It is VERY IMPORTANT that you set the unit with a modern firmware, or you’ll have a number of problems. Luckily this is very easy: check the current TFTP server address on Grandsteram site (see below) and enter it under the configuration page, and set “Yes, check for upgrade every 1 minute”. Reboot. The unit light should go red while the unit downloads and installs the new firmware, it will take like 5 minutes to update. Unit configuration Continue Reading...
Tunnelling with PuTTY
When accessing a remote Unix system from a windows machine, it is very common to be given shell access via SSH. It is also very common to need being forwarder port 80 (for web configuration of the system) and port 8080 (for QueueMetrics); and this is a hassle to set up for remote system administrators who need to forward not one but three ports on their firewall. By using PuTTY, it is possible to enable “tunnelling”, so that one or more remote ports (endpoints) are connected to some other ports on the local machine. To do this, open up PuTTY and select : Continue Reading...
Generic QueueMetrics startup script
This is a general-use startup script that can be used to start and stop QueueMetrics on any Unix system:
#! /bin/bash
#
# This script starts and stops QueueMetrics
#
export JAVA_HOME=/mnt/hd1/j2sdk/jdk1.5.0_06
export JAVA_OPTS="-Xms256M -Xmx256M"
export TOMCAT=/mnt/hd1/tomcat
case "$1" in
start)
echo "Starting up QueueMetrics"
echo "Using JAVA_HOME: $JAVA_HOME"
echo "Using JAVA_OPTS: $JAVA_OPTS"
$TOMCAT/bin/startup.sh
;;
stop)
echo "Shutting down QueueMetrics"
$TOMCAT/bin/shutdown.sh
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
exit 0
chmod 755 /etc/init.d/queuemetrics
update-rc.d queuemetrics defaults
chkconfig –-add queuemetrics
chkconfig –-list queuemetrics
chkconfig –-level 2345 queuemetrics on
Java translation encoding
Encoding a .properties file native2ascii -encoding ISO8859_1 src/$file dst/$file This even works on Win32 machines with Java installed. Continue Reading...
Removing unclosed entries from the queue_log
To find all single-event calls in your queue_log you can run the following query:
SELECT call_id, count( * ) , verb
FROM queue_log
WHERE partition = 'P001'
AND verb NOT IN (
'AGENTCALLBACKLOGIN', 'AGENTCALLBACKLOGOFF',
'AGENTLOGIN', 'AGENTLOGOFF',
'ADDMEMBER', 'REMOVEMEMBER',
'PAUSEREASON', 'CALLSTATUS'
)
GROUP BY call_id
HAVING count( * ) = 1
Yum quick-start
Installing and removing yum install queuemetrics yum remove queuemetrics Installing from a local file yum localinstall queuemetrics.rpm yum localupdate queuemetrics.rpm Which packages match a certain name?
yum list | grep -i queue |
queuemetrics.noarch 1.4.2-29 installed
queuemetrics-java.i386 1_5_0_11-16 installed
queuemetrics-tomcat.noarch 5.0.28-9 installed
queuemetrics-java-debuginfo.i386 1_5_0_06-14 LowayResearch
Loading "installonlyn" plugin
Setting up repositories
Reading repository metadata in from local files
Installed Packages
Name : queuemetrics
Arch : noarch
Version: 1.4.2
Release: 29
Size : 1.5 M
Repo : installed
Summary: Loway QueueMetrics
Description:
A queue_log analyzer for Asterisk.
Compressing recorded calls to MP3
If you record a big chunk of traffic (or even all traffic, as some call-centers do) on your Asterisk box, you will see that it ends up taking a substantial amount of disk space. The problem is the following: Continue Reading...
Recording all outgoing traffic for some extensions
You want to record all outgoing traffic done by some extensions - not all extensions (it would be trivial) but just some of your choosing. You also want to be able to turn recordings on or off without modifying the dialplan. How to do it The idea is simple: we use Asterisk’s internal database to record a flag for each extension that tells us whether to record those calls or not. We add a check for this flag before dialling out, so we can catch all outgoing traffic. Modifying the dialplan Whenever you are currently dialing out (we assume that any number starting with 0 is an external call) you add the following piece of dialplan:
exten => _0.,1,NoOP,Dial out with hidden CLID
exten => _0.,2,SetCallerPres(prohib)
exten => _0.,3,DBGet(rec=registra/${CALLERIDNUM})
exten => _0.,4,GotoIf($[ ${rec} = 1 ]?10:20)
exten => _0.,10,MixMonitor(REC-${CALLERIDNUM}-${UNIQUEID}.wav|b|)
exten => _0.,11,Goto(20)
exten => _0.,20,Dial(Zap/g1/${EXTEN:1})
database put registra 299 1
database put registra 299 0
ast*CLI> database show registra
/registra/223 : 1
/registra/224 : 0
/registra/299 : 1
[root@ast monitor]# ls -l /var/spool/asterisk/monitor/REC*
-rw-r--r-- 1 root root 186284 Aug 8 16:36 /var/spool/asterisk/monitor/REC-299-1186583777.73726.wav
-rw-r--r-- 1 root root 206764 Aug 8 16:40 /var/spool/asterisk/monitor/REC-299-1186584038.73774.wav