FreeBSD10: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
Startup mysql | Startup mysql | ||
echo mysql_enable=\"YES\" >> /etc/rc.conf | echo mysql_enable=\"YES\" >> /etc/rc.conf | ||
echo voipmonitor_enable=\"YES\" >> /etc/rc.conf | |||
vim /var/db/mysql/my.cnf | vim /var/db/mysql/my.cnf | ||
service mysql-server start | service mysql-server start | ||
Line 48: | Line 49: | ||
vi /usr/local/etc/rc.d/voipmonitor-ser | vi /usr/local/etc/rc.d/voipmonitor-ser | ||
#!/bin/sh | |||
# | |||
# | |||
# PROVIDE: voipmonitor | |||
# REQUIRE: DAEMON | |||
# KEYWORD: shutdown | |||
# | |||
. /etc/rc.subr | |||
name=voipmonitor | |||
rcvar=voipmonitor_enable | |||
load_rc_config $name | |||
pidfile=/var/run/${name}.pid | |||
command=/usr/local/bin/${name} | |||
run_rc_command "$1" | |||
service voipmonitor start |
Revision as of 15:05, 21 October 2014
note:tested on 32bit release
Install packages
pkg install libexecinfo libpcap unixODBC mysql55-client libvorbis libogg vorbis-tools gmake subversion wget bash libssh git mysql56-server-5.6.21 autotools
Startup mysql
echo mysql_enable=\"YES\" >> /etc/rc.conf echo voipmonitor_enable=\"YES\" >> /etc/rc.conf vim /var/db/mysql/my.cnf service mysql-server start
Download and install snappy
cd /usr/src wget --no-check-certificate https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz tar xzf snappy-1.1.1.tar.gz cd snappy-1.1.1 ./configure make make install
Download and install json-c
cd /usr/src git clone https://github.com/json-c/json-c.git; cd json-c; sh autogen.sh; ./configure; make; make install ln -s /usr/local/lib/libjson-c.so.2.0.0 /usr/lib/libjson.so /etc/rc.d/ldconfig restart
Download and install voipmonitor
cd /usr/src git clone git://git.code.sf.net/p/voipmonitor/git voipmonitor-git cd voipmonitor-git ./configure ln -s /usr/bin/c++ /usr/sbin/g++ mv tools.cpp tools.cpp.bak sed '/json\/json.h/s//json-c\/json.h/' tools.cpp.bak > tools.cpp mv sql_db.cpp sql_db.cpp.bak sed '/unsigned int errno/s//unsigned int errno2/' sql_db.cpp.bak > sql_db.cpp mv sql_db.cpp sql_db.cpp.bak2 sed '/if(errno)/s//if(errno2)/' sql_db.cpp.bak2 > sql_db.cpp gmake //this command halt with complaining about multiple definitions when linking voipmonitor, issue this command: "/usr/bin/ld" --allow-multiple-definition -o voipmonitor /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/local/lib/mysql -L/usr/lib/mysql -L/usr/local/lib/ -L/usr/lib64/mysql -L/usr/lib config_mysql.o regcache.o codec_alaw.o codec_ulaw.o format_slinear.o format_wav.o format_ogg.o calltable.o rtp.o voipmonitor.o sniff.o jitterbuffer/astmm.o jitterbuffer/utils.o jitterbuffer/fixedjitterbuf.o jitterbuffer/jitterbuf.o jitterbuffer/abstract_jb.o jitterbuffer/frame.o manager.o tools.o filter_mysql.o hash.o mos_g729.o odbc.o rtcp.o pcap_queue.o sql_db.o md5.o mirrorip.o ipaccount.o skinny.o pstat.o generator.o tcpreassembly.o http.o cleanspool.o fraud.o rrd.o -lpthread -lpcap -lz -lvorbis -lvorbisenc -logg -lodbc -lmysqlclient -lrt -lsnappy -lcurl -lssl -lcrypto -ljson -lssh -lssh_threads -lxml2 -lrrd -lc++ -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o gmake install
Startup voipmonitor
cd /usr/src/voipmonitor-git cp config/init.d/voipmonitor /usr/sbin/voipmonitor
vi /usr/local/etc/rc.d/voipmonitor-ser
#!/bin/sh # # # PROVIDE: voipmonitor # REQUIRE: DAEMON # KEYWORD: shutdown # . /etc/rc.subr name=voipmonitor rcvar=voipmonitor_enable load_rc_config $name pidfile=/var/run/${name}.pid command=/usr/local/bin/${name} run_rc_command "$1"
service voipmonitor start