北京赛车黑马人工计划configuration file has only one section named [general] where all configuration directives belongs. list of directives will now follow with their description and recommendation values. name in [ ] brackets is equivalent for command line which takes precendence over configuration file. in case of running more voipmonitor instances on the same or another servers configured to save to one database and the same cdr table it is possible to differentiate cdr by id_sensor column. if you set id_sensor >= 0 the number will be saved in cdr.id_sensor column.
in case of running more voipmonitor instances on the same or another servers configured to save to one database and the same cdr table it is possible to differentiate cdr by id_sensor column. if you set id_sensor >= 0 the number will be saved in cdr.id_sensor column. the number is between 1 - 65535 (16bit number)
id_sensor = 1
listening interface. can be 'any' which will listen on all interfaces - note that "any" will not put intefaces into promiscuous mode and you have to do it with "ifconfig eth0 promisc". you can also sniff on multiple interfaces by providing list of them delimited by ',' example: interface = eth0,eth1 command line option is -i
#interface = eth0,eth1 #interface = any interface = eth0
- default threading_mod = 1 uses one thread for reading from interface doing deduplication at once* threading_mod = 2 (which is automatically set if you have multiple interfaces (interface = eth0,eth1,...)) reads from each interface in separate thread which is better option on multi core systems than interface = any * threading_mod = 3 will do deduplication (if enabled) in separate thread which is needed for high traffic* threading_mod = 4 will do deduplication in more than one threads - use this option if you enable deduplication and your traffic is over 100Mbit
threading_mod = 1
since version 8 sniffer implements new mirroring option. sender is packing data to compressed stream over the tcp to remote sniffer. if you are going to use this sniffer only as a mirroring sniffer all you need is to set interface, packetbuffer_* set compression on and set packetbuffer_file_* so in case the connection to remote sniffer will die or will be temporarily slow the sender will not loose single packet. the mirroring is trying to reconnect in case of failure. packets are mirrored including the the original timestamp and headers. this mirroring hopefully replaces pcapscandir feature which will be probably removed in favor of this approach.
北京赛车黑马人工计划the sender needs to set only interface, ringbuffer, packetbuffer_*, filter and this two folling mirror_destination_*
mirror_destination_ip = mirror_destination_port =
on receiver set mirror_bind_ip and mirror_bind_port. do not forget to set firewall so no other except the sender will be able to connect to the receiver
mirror_bind_ip = mirror_bind_port =
北京赛车黑马人工计划scan pcap files folder and read file by file. this is in conjunction with running tcpdump which creates pcap file each 5 seconds (-g 5) storing pcap files named by unix_timestamp to /dev/shm/voipmonitor folder (do not forget create it) using 1gb ring buffer to avoid losing packets (-b500000 - you can lower it but not higher) filtering udp packets (udp parameter whcih you can change to your needs). voipmonitor then reads created files (and delete it after processing. this approach can be used for testing throughput or for very high voip traffic (>500mbit). if the sniffer is able to process pcap files in realtime - there will be in /dev/shm/voipmonitor folder only one or two pcap files. if the sniffer is not able to process in realtime (blocking by i/o or by cpu) number of pcap files will grow faster then the sniffer is able process.
scanpcapdir = /dev/shm/voipmonitor
warning: libpcap < 1.1 contains memory leak when pcap filter is set - do not set filter in this config or upgrade libpcap to the latest (debian 6 libpcap contains the leak) static compiled voipmonitor from tomcovafarm.com contains the latest libpcap
tcpdump example command: nice -n -20 tcpdump -B500000 -i eth2 udp -G 5 -w /dev/shm/voipmonitor 2>/dev/null 1>/dev/null &
北京赛车黑马人工计划ringbuffer is circular memory queue directly in kernel memory space. libpcap is reading from this queue and delivers packets to voipmonitor. if the network rate is > 100 mbit we recommend to set ringbuffer to at least 500. maximum value is 2000 mb. ringbuffer = 50 [ --ring-buffer ]
packet buffer is new voipmonitor buffering architecture (since version 8). if enabled new threads are created which raads packets from kernel ringbuffer and queues them into dynamically allocated memory. packets are dequeued and passed to next threads which reads the content. this will ensure that kernel ringbuffer will not overrun due to cpu or disk i/o spikes. packet buffer will dynamically grow until packetbuffer_total_maxheap is reached. compression can be enabled (packetbuffer_compress) which compress the buffer with fast snappy algorythm with 50% compression ratio thus doubling the time when the buffer gets filled (600mbit traffic consumes ~30% one one core xeon e5-2620).
it is also possible to use disk buffer if the packet buffer memory is filled by enabling packetbuffer_file_totalmaxsize which is usefull when sniffer is only mirroring data over tcp to another sniffer - if the connection brakes or slowed down and packet buffer gets filled it will start using file buffer until the connection reestablishes so no single packet is lost. enabling file buffer in non mirroring mode to the same disk as spooldir will get not much benefit because if the process is blocked mainly due to disk i/o it has no benefit to add more i/o by caching unprocessed packets to the same i/o layer.
packetbuffer_enable = yes packetbuffer_total_maxheap = 2000 #in MB packetbuffer_compress = no #enable compression if you have >2 CPU cores packetbuffer_file_totalmaxsize = 0 #MB. Default is disabled. packetbuffer_file_path = /var/spool/voipmonitor/packetbuffer
number of threads to process rtp packets. if not specified it will be number of available cpus - 1. if equal to zero rtp threading is turned off. each thread allocates default 20mb for buffers (increase to 100 on very high loads). this buffer can be controlled with rtpthread-buffer. for < 150 concurrent calls you can turn it off.
rtpthreads = 3
北京赛车黑马人工计划since 8.4rc17 if voip sip device (with source ip 22.214.171.124) sends in sdp that it wants rtp for example to 10.0.0.1 and port 10000 the call also sniff rtp from 126.96.36.199:10000 or to 188.8.131.52:10000 which does more problems than it solves. now this behaviour is changed and if you need this option back you can enable it
sdp_reverse_ipport = yes
in case the sip(media) server is behind public ip (184.108.40.206) nated to private ip (10.0.0.3) to sniff all traffic correctly you can specify alias for this case. you can specify more netaliases duplicating rows. in most cases this is not necessary because voipmonitor is able to track both rtp streams based on the other side ip. but if the stream is incoming from another ip then sip source signalization and also from another ip than the sip device which is also behind nat its impossible to track the correct ip. please note that this is for case where the sip server is behind nat and also the client is behind nat. if your sip server has public ip do not bother with this.
natalias = 220.127.116.11 10.0.0.3 natalias = 18.104.22.168 10.0.0.4
北京赛车黑马人工计划define bind address for manager interface. default is 127.0.0.1 it is not recommended to change this unless really needed due to security. if you need it on some other ip make sure you set firewall and change the standard port for better security
managerip = 127.0.0.1
this specifies tcp port which will voipmonitor listen for incoming connections which controls voipmonitor or for getting information about calls. *reload configuration echo reload | nc localhost 5029 *get number of calls echo totalcalls | nc localhost 5029 *get list of calls in json format echo listcalls | nc localhost 5029
managerport = 5029 [ --manager-port <port number> ]
北京赛车黑马人工计划connects to server and listen for commands.
managerclient = serverip or hostname managerclientport = 1234
take number from invite uri or to: sip header. if destination_number_mode = 1 it will always save number from to: header. if destination_number_mode = 2 it will take number from invite uri.
destination_number_mode = 1
define sip ports wihch will voipmonitor listen. for each port make new line with sipport = port (multiple lines)
sipport = 5060 sipport = 5061 sipport = 5062
enable storing sip source and destination port to database so the port from invite can be searched. default is disabled.
cdr_sipport = yes
enable storing rtp destination port to database
rtptimeout is important value which specifies how much seconds from the last sip packet or rtp packet is call closed and writen to database. it means that if you need to monitor only sip you have to set this to at leat 2 hours = 7200 assuming your calls is not longer than 2 hours. take in mind that seting this to very large value will cause to keep call in memory in case the call lost bye and can consume all memory and slows down the sniffer - so do not set it to very high numbers. default is 300 seconds.
rtptimeout = 300
by default voipmonitor uses three types of jitterbuffer simulators to compute mos score. first variant is saved into cdr.[ab]_f1 and represents mos score for devices which has only fixed 50ms jitterbuffer. second variant is same as first but for fixed 200ms and is saved to cdr.[ab]_f2 third varinat is adaptive jitterbuffer simulator up to 500ms jitterbuffer simulator is the most cpu intensive task which is voipmonitor doing. if you are hitting cpu 100% turn off some of the jitterbuffer simulator. recommended for higher loads is to use only fixed 200ms (f1)
jitterbuffer_f1 = yes jitterbuffer_f2 = yes jitterbuffer_adapt = yes
callslimit will limit maximum numbers of calls processed by voipmonitor at the same time. if calls are over limit it will be ignored (invite)
callslimit = 0
in case sip session travels accross several proxies (and call-id header does not change) and you would like to track all sip proxies and make them searchable in gui / database. if disabled cdr will store to destination sip column destination ip from the first invite. if enabled there will be destination ip from the latest invite and all proxy ip will be stored in cdr_proxy table.
北京赛车黑马人工计划default = yes
cdrproxy = yes
this option allows to skip storing cdr.a_ua and cdr.b_ua - this is workaround for those who has extreme cdr rate and number of user agents in database is over 1000 and cpu is not powerfull enough to store cdr in real time. in future this option will be removed once we optimize this rutine. default = yes
cdr_ua_enable = yes
this is important option if voipmonitor is sniffing on sip proxy like kamailio or openser and sees both rtp leg of call. in that case use this option. it will analyze rtp only for the first leg and not each 4 rtp streams which will confuse voipmonitor. drawback of this switch is that voipmonitor will analyze sdp only for sip packets which have the same ip and port of the first invite source ip and port. it means it will not work in case where phone sends invite from a.b.c.d:1024 and sip proxy replies to a.b.c.d:5060.
rtp-firstleg = no [ --rtp-firstleg ]
- since 8.0.2
- default = no
北京赛车黑马人工计划ssrc in rtp headers must not equal zero according to rfc so voipmonitor is ignoring such rtp by default. if you still need to parse such packets enable it
allow-zerossrc = yes
duplicate check do md5 sum for each packet and if md5 is same as previous packet it will discard it. warning: md5 is expensive function (slows voipmonitor 3 times) so use it only if you have enough cpu or for pcap conversion only. default is no.
deduplicate = yes
- since 8.1
北京赛车黑马人工计划prior verison 8.0.1 deduplicate was comparing only data without ip header and udp header so duplicate packets was matched also in case the ip addresses differes. this was good for some cases but it leads to completely ignore rtp streams in other cases. now default option is to check duplicates based on not only data but ip headers too. to change this set deduplicate_ipheader = no. default = yes.
deduplicate_ipheader = yes
enable/disable updating called number from To: header from each caller INVITE. Default is enabled so it supports overlap dialing (RFC 3578)if you want to disable this behaviour and see always number only from the first INVITE set sipoverlap = no
sipoverlap = yes
enable parsing of sip register message. sql register table stores active sip registrations. once it expires it is removed from the table to new sql register_state table. the register state table is used to store changes in registrations. sql table register_failed is used to store all failed sip register. to not overload this table there is counter column which adds +1 for each failed register from the same source.
sip-register = no [ -R ]
wait only n seconds for reply on first register then remove from memory. (default is 5 seconds). since 9.4 version.
sip-register-timeout = 5
if mysql binlog is enabled, skip binlog inserts into active table (which is memory type) if you still want to replicate this too (huge i/o impact) set it to = no sip-register-active-nologbin = yes
if yes, all sip calls will be ignored unless capture rules set skip flag based on ip or tel. numbers (mysql.filter_*)
skipdefault = yes
北京赛车黑马人工计划if yes, voipmonitor will not save cdr to mysql
nocdr = no [ -c ]
北京赛车黑马人工计划limit pcap file size (in mb). default disabled. since 8.4
maxpcapsize = 500
北京赛车黑马人工计划store sip packets to pcap file.
savesip = [ --sip-register ]
save rtp packets to pcap file. savertp = yes automatically saves rtcp packets you can also save only rtp header without audio: savertp = header if save rtp is aneblad it will also save udptl packets (used for t.38) you can also set savertp = no and control what calls will record rtp in mysql table filter_ip or filter_tel which is controled in gui -> capture rules. sending reload command will reload configuration from filter_* table. you can also set savertp = yes but denies recording rtp based on rules in filter_* table.
savertp = yes | header [ -R ]
北京赛车黑马人工计划voipmonitor by default splits sip and rtp packets to individual files (in case spooldiroldschema = no) which are located in sip and rtp directories. this feature allows instance cleaning rtp streams differently then sip packets to join two pcap files sip+rtp use mergecap command line utility which is included in wireshark package default = yes | spooldiroldschema must be set to no
pcapsplit = yes
北京赛车黑马人工计划store rtcp packets to pcap file.
savertcp = yes [ --save-rtcp ]
北京赛车黑马人工计划save udptl packets (t.38). if savertp = yes the udptl packets are saved automatically. if savertp = no and you want to save only udptl packets enable saveudptl = yes and savertp = no
saveudptl = yes
北京赛车黑马人工计划this is usefull only if you have commercial web gui which uses graph files for ploting graph
savegraph = plain [ -G or --save-graph=[gzip|plain] ]
北京赛车黑马人工计划save rtp payload to audio file. choose 'wav' for wav pcm or 'ogg' for ogg 25kbps format. please note that this has great impact on i/o and can overload your storage leading to lose packets. better way is to store only sip+rtp and convert wav files on demand.
saveaudio = wav
by default wav file is stereo where left channel is caller and right channel is called. if you want to swap left right enable saveaudio_reversestereo default is no
saveaudio_reversestereo = no
- since 8.0.2
北京赛车黑马人工计划in case you need to have ethernet encapsulation and you are sniffing on interface = any set this to = yes. this is needed only in case you need to merge pcap files with different encapsulations. default is no.
convert_dlt_sll2en10 = no
default path to web gui used to construct path to key check for codecs
default paths: #keycheck = /var/www/voipmonitor/php/keycheck.php #keycheck = /var/www/html/voipmonitor/php/keycheck.php
in case you are not saving rtp at all but you still want to save dtmf carried over rtp packets (rfc2833) you can enable this option. this feature slows down a bit processing rtp packets in main read thread in casse voipmonitor runs in threads. default = 0
saverfc2833 = 0
北京赛车黑马人工计划enable storing dtmf (sip info or rfc2833) to cdr_dtmf database. it will store dtmf time and key then it will be shown in sip history in the gui
dtmf2db = 0
北京赛车黑马人工计划if any of sip message during the call contains header x-voipmonitor-norecord call will be not converted to wav and pcap file will be deleted.
norecord-header = yes
= norecord-dtmf =if any of sip message during the call contains dtmf info sequence "*0" call will be not converted to wav and pcap file will be deleted. default: disabled
norecord-dtmf = yes
enable pausing rtp/wav recording if dtmf sequence detected. default: disabled
pauserecordingdtmf = *9
dump all packets to /tmp/voipmonitor-[unix_timestamp].pcap
dumpallpackets = yes
北京赛车黑马人工计划enable mos score for g.729 codec. if enabled, all cdr with 0 packet loss and stable delays will have maximum mos of 3.92 and for loss and unstable delay mos will be calculated according to itu-t objective pesq method for g.729 codec. if you want to use mos as good search value which corellates loss and delay into single value leave it disabled (which is by default). if set to no, all calls will be calculated like it is g.711. recommended value = no
mos_g729 = no
enable storing custom sip headers to database column cdr_next.custom_header_headername. You can specify more headers delimited by ";". WARNING - when you enable this feature voipmonitor will autoupgrade cdr_next table which can take hours depending on how large the table is. In GUI there is new section Settings#CDR_Custom_header.
custom_headers = X-asterisk-Info ; X-myheader
北京赛车黑马人工计划analogical for sip message is custom_headers_message
custom_headers_message = X-asterisk-Info ; X-myheader
enable saving content of custom header (typicaly in-reply-to) to cdr_next.match_header this header is used in related cdr gui for matching legs to onen call
match_header = in-reply-to
北京赛车黑马人工计划pcapcommand will run command after pcap file is closed (after call ends). %pcap% is substitution for real pcap file name. execution is guaranteed to run in serialized way (not in parallel)warning - pcapcommand is implemented by forking program which is very expensive and is causing tlb shootouts on multicore system which can generate 500 000 interrupts / sec causing system to drop packets. watch the performance carefuly (with "vmstat 1" column "in"). gziping pcap files will be implemented as native function directly in c++ to obey tlb shootdowns.
pcapcommand = gzip %pcap%
- since 8.3
北京赛车黑马人工计划filtercommand will run command after each call which matches script == 1 in filter_ip or filter_telnum (capture rules in gui) warning - filtercommand is implemented by forking program which is very expensive and is causing tlb shootouts on multicore system which can generate 500 000 interrupts per seconds causing system to drop packets. watch the performance carefuly (with "vmstat 1" column "in").
all non alphanum characters except '/' '#' ' ' '+' ':' '-' '.' and '@' in callid, dirname, caller, called and calldate are substituted to '_'
default is disabled
filtercommand = myscript '%basename%' '%dirname%' '%caller%' '%called%' '%calldate%'
libpcap tcpdump style filter. voipmonitor listens in default only for udp packets. unfortunatly filtering udp packets will filter all vlan tagged packets which means that you cannot filter only udp if you want to listen to vlan tagged packets.
WARNING - if you need to sniff IPinIP (like mirrored packets from voipmonitor) filter = udp will filter all those packets. In this case just disable filter.
filter = udp or (vlan and udp) [ -f ]
北京赛车黑马人工计划list characters that should be converted to underscore (_) in filenames if you want to include space, put it between other characters, like ': :' (will convert ':' and ' ' to '_') defaults to nore
# example - avoid ':' when Call-Id contains port number convertchar = :
北京赛车黑马人工计划this is directory where all pcap/graph/wav files are stored.
spooldir = /var/spool/voipmonitor [ -d ]
new spooldir schema stores all files to year-mon-day/hour/minute/[all|sip|rtp|audio] directories if you need to have the old schema year-mon-day/* enable spooldiroldschema = yes. default = no
spooldiroldschema = no
北京赛车黑马人工计划store pcap and graph file to <cache/dir> and move it after call ends to spool directory. moving all files are guaranteed to be serialized which solves slow random write i/o on magnetic or other media. typical cache directory is /dev/shm/voipmonitor which is in ram and grows automatically or /mnt/ssd/voipmonitor which is mounted to ssd disk or some very fast sas/sata disk where spool can be network storage or raid5 etc. wav files are not implemented yet
cachedir = /dev/shm/voipmonitor
北京赛车黑马人工计划since version 8 sniffer uses different cleaning mechanism which was developed to minimize i/o operations and it also finally brings more features each created file is indexed in spooldir/filesindex/ in hours interval and the file size is added to aggregation mysql table files. cleaning procedure iterates through index files and unlink files without need to scan directories.cleaning procedure runs every hour and checks size or days according to following options. rules are executed in this order. if you set maxpoolsize it will wipe out the oldest data every hour until the size is reached. maxpooldays keeps maximum number of data to set days. the same is for sip rtp and graph so you can keep sip pcaps longer than rtp pcaps. all options can be activated at once
北京赛车黑马人工计划it is good to always have maxpoolsize = n where the n is maximum disk space you are willing to use by sniffer all size are in mb
maxpoolsize = 102400 #maxpooldays =
maxpoolsipsize = maxpoolsipdays =
maxpoolrtpsize = maxpoolrtpdays =
maxpoolgraphsize = maxpoolgraphdays =
in case the space is below 1% and below 5GB (which is default threshold) reindexfiles procedure will be executed and cleaning will be restarted. In case this will not help the new maxpoolsize will be set to size of current spool directory and will keep free space MIN(1% freespace, 5GB)
default is autoclean enabled, 1% free space or 5gb free space
autocleanspool = yes autocleanspoolminpercent = 1 autocleanmingb = 5
北京赛车黑马人工计划removes cdr* partitions older then set number of days. if set to 0 it is disabled (default)
cleandatabase_cdr = 0
removes register_state partitions older then set number of days. if set to 0 it is disabled (default)
removes cleandatabase_register_failed partitions older then set number of days. if set to 0 it is disabled (default)
sets cleandatabase_cdr and cleandatabase_register_state and cleandatabase_register_failed to the same values. configuration first look at cleandatabase parameter then it looks for other cleandatabase_* parameters. the number is number of days to retain in database for cdr and register records.
default is disabled
cleandatabase = 0
this option is only relevant if you are mirroring traffic to your network card/cards. this will not work if interface = any - in this case, use ifconfig to put your desired interfaces to promis mode. default value is yes and you want to turn it of on command line ues -n which will turn it off.
promisc = yes [ -n ]
sqldriver = mysql #sqldriver = odbc #odbcdriver = mssql #odbsdsn = voipmonitor #odbcuser = root #odbcpass =
北京赛车黑马人工计划voipmonitor can connect to mysql server or odbc driver. connecting voipmonitor to msssql please refer to readme.mssql
use partitioning cdr* tables by day. if you have schema without partitioning, you must start with new database. default is = yes
cdr_partition = yes
北京赛车黑马人工计划in case you need to create partitions back to 90 days for example use this option. this is useful when you want to migrate data.
create_old_partitions = yes | no create_old_partitions_from = 90 [days]
disable_partition_operations (since 8.4RC9)
disable partition creation which runs every 12 hours. if you have multiple sensors storing to one database it is redundant to create partitions by all sensors. default = no
disable_partition_operations = yes
mysql server, default is 127.0.0.1 (localhost). command line option is -h
mysqlhost = 127.0.0.1
北京赛车黑马人工计划mysql database, default is voipmonitor. command line option is -b
mysqldb = voipmonitor
mysql username, default is root
mysqlusername = root
mysql password, default is no password
if https failes when upgrading the sniffer try also http
upgrade_try_http_if_https_fail = yes