You have several choices (like always on Unix):
1. Do like this:
if (method=="INVITE") {
# save messages in mysql for CDRTool
exec_msg("/etc/ser/sertrace.py; exit 1");
};
Make your own script to replace /etc/ser/sertrace.py
You can log the whole SIP packet from STDIN to mysql and index it by
environment variable set by SER (SIP_HF_CALLID).
To scale it up a bit you demonize the logger to reuse only one mysql
connection.
2. Log all SIP packets to a log file with a script like this one:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<
#!/bin/sh
#
# chkconfig: 2345 20 80
# description: controls execution of SIP sniffer
# processname: ng
NAME=ngrep
OPTIONS="-L -d bond0 -t port 5060"
BIN=/usr/bin/ngrep
ROTATE=/usr/sbin/rotatelogs
RETVAL=0
# See how we were called.
case "$1" in
start)
killall $NAME
echo -n "Starting SIP sniffer: "
$BIN $OPTIONS 2>&1 | $ROTATE /var/log/ser/trace/sip 86400 &
RETVAL=$?
echo "ngrep."
;;
stop)
echo -n "Stopping SIP ngrep: "
killall $NAME
RETVAL=$?
echo "done."
;;
restart)
#$0 stop
$0 start
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $RETVAL
<<<<<<<<<<<<<<<<<<<<<<<<
--
Adrian
How to get the call log and registration request in a
different file other that /var/log/messages.
Also, can i get some more details on autherisation and
accountingpackets. Rt now, iam getting only details
given below.
ACC: transaction answered: method=BY
E, i-uri=sip:12334 at 10.10.0.1,
o-uri=sip:12334 at 10.10.0.1, call_id
=4F6F069B-4BF4-4CC7-B99C-4E24F0E2C667 at 192.168.10.154,
from=Manu Sip <sip:manu at s
ip.test.net>;tag=2654486816, code=200
thank you.
MANU.