Skip to content

Commit

Permalink
- Implement configuration file. See config/voipmonitor.org
Browse files Browse the repository at this point in the history
- Implement generic init script. See config/init.d/voipmonitor
(thanks Telephonic http://telephonic.ca for sponsoring this work)
- Change core dump to unlimited
  • Loading branch information
Martin Vit committed May 7, 2011
1 parent 7fbc3af commit 6492fd8
Show file tree
Hide file tree
Showing 25 changed files with 7,195 additions and 15 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/codec_ulaw.cpp -text
/codec_ulaw.h -text
/codecs.h -text
config/init.d/voipmonitor -text
config/voipmonitor.conf -text
/format_wav.cpp -text
/format_wav.h -text
gzstream/COPYING.LIB -text
Expand Down Expand Up @@ -71,6 +73,26 @@ jitterbuffer/jitterbuf.h -text
jitterbuffer/utils.c -text
/rtp.cpp -text
/rtp.h -text
simpleini/ConvertUTF.c -text
simpleini/ConvertUTF.h -text
simpleini/Makefile -text
simpleini/SimpleIni.h -text
simpleini/SimpleIni.sln -text
simpleini/SimpleIni.vcproj -text
simpleini/ini.syn -text
simpleini/package.cmd -text
simpleini/simpleini.doxy -text
simpleini/simpleini.dsp -text
simpleini/simpleini.dsw -text
simpleini/snippets.cpp -text
simpleini/test.cmd -text
simpleini/test1-expected.ini -text
simpleini/test1-input.ini -text
simpleini/test1.cpp -text
simpleini/testsi-EUCJP.ini -text
simpleini/testsi-SJIS.ini -text
simpleini/testsi-UTF8.ini -text
simpleini/testsi.cpp -text
/sniff.cpp -text
/sniff.h -text
/voipmonitor.cpp -text
Expand Down
5 changes: 5 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Key features
- Detailed delay/loss statistics stored to MySQL
- Each call is saved as standalone pcap file

Sponsors and contributors
-------------------------
- Telephonic http://telephonic.ca
* init script, configuration file

What is required
----------------

Expand Down
61 changes: 61 additions & 0 deletions config/init.d/voipmonitor
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
TERM="linux";
ARGS="-i eth0"
PIDFILE=/var/run/voipmonitor.pid

case "$1" in
start)
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
NAME=`ps -o comm= $PID`
if [ "$NAME" == "voipmonitor" ]; then
echo "Voipmonitor is already running"
else
rm $PIDFILE
echo -n "Starting voipmonitor: "
voipmonitor --pid-file /var/run/voipmonitor.pid $ARGS
fi
else
echo -n "Starting voipmonitor: "
voipmonitor --pid-file /var/run/voipmonitor.pid $ARGS
fi
;;
stop)
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
NAME=`ps -o comm= $PID`
if [ "$NAME" == "voipmonitor" ]; then
echo "Sending kill signal to voipmonitor"
kill $PID
else
echo "voipmonitor is not running";
rm $PIDFILE
fi
else
echo "voipmonitor is not running";
fi
;;
force-stop)
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
NAME=`ps -o comm= $PID`
if [ "$NAME" == "voipmonitor" ]; then
echo "Sending kill signal to voipmonitor"
kill -9 $PID
else
echo "voipmonitor is not running";
rm $PIDFILE
fi
else
echo "voipmonitor is not running";
fi
;;
*)
echo "Usage: /etc/init.d/voipmonitor {start|stop|force-stopn}"
;;
esac

exit 0

56 changes: 56 additions & 0 deletions config/voipmonitor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#
# voipmonitor.org configuration file
#
# location of this file is at ~/.voipmonitor.conf or /etc/voipmonitor.conf
# command line parameters overrides configuration directives in this file
# allowed comments are ; or #
#

[general]

#listening interface. Can be 'any' which will listen on all interfaces
;interface = eth0

#if yes, voipmonitor will not save CDR to MySQL
nocdr = yes

#save SIP packets to pcap file
;savesip = no

# save RTP packets to pcap file
;savertp = no

# save extracted WAV file
;savewav = no

# save RAW packet data from RTP
;saveraw = no

# save graph data for web GUI. If you want to complress it, put here gzip
;savegraph = plain

# Pcap filter. If you want to sniff only UDP SIP, put here 'udp'. Warning: If you set protocol to 'udp' pcap discards VLAN packets. Maximum size is 2040 chars
;filter = udp

# directory where all files (pcap|wav|graph) are stored
;spooldir = /var/spool/voipmonitor

# put interface to promiscuouse mode so it can sniff packets which are not routed directly to us
;promisc = yes

# mysql server
;myqslhost = localhosta

# mysql database
;mysqldb = voipmonitor

# mysql table
;mysqltable = cdr

# mysql username
;mysqlusername = root

# mysql password
;mysqlpassword =


Loading

0 comments on commit 6492fd8

Please sign in to comment.