Exporting queue_log data
This query lets you export the contents of the queue_log table in SQL format for inspection. Instead of exporting the whole table, it exports only the period specified.
/usr/bin/mysqldump \\
-h localhost \\
-u queuemetrics -p \\
--databases queuemetrics \\
--tables queue_log \\
--where="time_id between \\
unix_timestamp('2008-10-23 00:00:00') \\
and unix_timestamp('2008-10-28 00:00:00')" \\
> outfile.sql
bzip2 outfile.sql
New server 100210
Listening to multi-folder recordings in queuemetrics
It is possible to have QueueMetrics search for recordings in multiple directories, e.g. one directory for each day. This has the great advantage of being faster (because QueueMetrics does not have to scan through the whole file set) and more manageable (because you can easily move files around by date e.g. from a local volume to a NAS unit as needed). In order to do this, you have to configure “LocalFilesByDay” storage in QueueMetrics. In this example, we imagine that your recordings are held in a directory structure like /recordings/YYYY/MM/DD/myfile.wav It is also mandatory that all files have in their name the unique-id of the call that was recorded, so that QM can match audio files to calls. Continue Reading...
Storing audio files in subfolders
It is often useful to store audio recordings in different subfolders, e.g. per day. We imagine that you want to record queue traffic on an external volume called /recording . Continue Reading...
How to reboot a Draytek 2600 router
This recipe explains how to reboot a Draytek Vigor 2600 router from the Unix command line. Simply run the following command to reboot router 192.168.5.1 whith administrative user USER password PASS:
wget -O - "http://USER:PASS@192.168.5.1/cgi-bin/reboot.cgi?sReboot=Current&submit=++OK++"
--14:17:50-- http://USER:*password*@192.168.5.1/cgi-bin/reboot.cgi?sReboot=Current&submit=++OK++
=> `-'
Connecting to 192.168.5.1:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://192.168.5.1/doc/reboot1.sht [following]
--14:17:51-- http://192.168.5.1/doc/reboot1.sht
=> `-'
Connecting to 192.168.5.1:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.
Updating QueueMetrics using yum
If you did the original installation of QueueMetrics using yum, updating it is very easy. Continue Reading...
IPMI sensors under Debian
Monitoring hardware sensors can be extremely useful for a production server. Recent servers - in my case a quad-code HP ML310 G5 - often adhere to a standard called IPMI for hardware monitoring. My Debian kernel does not automatically load the required IPMI drivers, though the kernel modules are actually present with the distribuited kernel (in my case a 2.6.18-6-686-bigmem #1 SMP). In order to make them work, I have to manually load IPMI modules:
modprobe ipmi_si
modprobe ipmi_devintf
ml310:~# lsmod | grep ipmi
ipmi_devintf 9320 0
ipmi_si 34572 0
ipmi_msghandler 32288 2 ipmi_devintf,ipmi_si
apt-get install ipmitools
ml310:~# ipmitool -I open sdr list
Int. Health LED | 0 unspecified | ok
VRM (CPU1) | 0 unspecified | cr
CPU Fan | 60.37 unspecifi | nc
Rear Fan | 33.32 unspecifi | nc
Temp 1 | 24 degrees C | ok
Temp 2 | 30 degrees C | ok
Temp 3 | 19 degrees C | ok
ml310:~# ipmitool -I open sdr get 'Temp 1'
Sensor ID : Temp 1 (0x5)
Entity ID : 7.1 (System Board)
Sensor Type (Analog) : Temperature
Sensor Reading : 24 (+/- 0) degrees C
Status : ok
Positive Hysteresis : Unspecified
Negative Hysteresis : Unspecified
Minimum sensor range : -127.000
Maximum sensor range : Unspecified
Event Message Control : Entire Sensor Only
Readable Thresholds :
Settable Thresholds : ucr unr
Threshold Read Mask : ucr unr
Compiling Asterisk on EPIA with VIA C3
Some EPIA boards are based on the VIA C3 processor, that is basically a clone of an i686 that does not support the whole instruction set. Therefore, in order to be sure that what you try to execute will actually work, you have to compile as if the processor were an i586, though Debian Etch thinks to be on an i686:
gimel:~/asterisk-1.4.18.1# uname -a
Linux gimel 2.6.18-5-486 #1 Fri Jun 1 00:07:22 UTC 2007 i686 GNU/Linux
apt-get install linux-headers-2.6.18-5-486
apt-get update
apt-get install linux-headers-2.6.18-5-486
wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.18.1.tar.gz
wget http://downloads.digium.com/pub/zaptel/releases/zaptel-1.4.9.2.tar.gz
wget http://downloads.digium.com/pub/libpri/releases/libpri-1.4.3.tar.gz
tar zxvf zaptel-1.4.9.2.tar.gz
cd zaptel-1.4.9.2
./configure
#ARCH:=$(shell uname -m | sed -e s/i.86/i386/)
ARCH=i586
export CFLAGS="-march=i586"
make menuconfig
make
make install
cd ..
tar zxvf libpri-1.4.3.tar.gz
cd libpri-1.4.3
make
make install
cd ..
cd asterisk-1.4.18.1
./configure --build=pentium
ASTLDFLAGS+=$(LDOPTS) -lpthread -lresolv
make menuconfig
make
make install
make samples
Translation times between formats (in milliseconds) for one second of data
Source Format (Rows) Destination Format (Columns)
g723 gsm ulaw alaw g726aal2 adpcm slin lpc10 g729 speex ilbc g726 g722
g723 - - - - - - - - - - - - -
gsm - - 6 6 15 6 5 26 - - 110 15 -
ulaw - 23 - 1 11 2 1 22 - - 106 11 -
alaw - 23 1 - 11 2 1 22 - - 106 11 -
g726aal2 - 32 11 11 - 11 10 31 - - 115 1 -
adpcm - 23 2 2 11 - 1 22 - - 106 11 -
slin - 22 1 1 10 1 - 21 - - 105 10 -
lpc10 - 55 34 34 43 34 33 - - - 138 43 -
g729 - - - - - - - - - - - - -
speex - - - - - - - - - - - - -
ilbc - 43 22 22 31 22 21 42 - - - 31 -
g726 - 31 10 10 1 10 9 30 - - 114 - -
g722 - - - - - - - - - - - - -