Newer
Older
# start a test series of sipp-calls with specs from a config file
# log data about the tests so that files can be combined to edible reports
# by qstream-sipp-check
if test .$1 = .-cf ; then
source $2
shift;shift
else
source /etc/sipshaman/sipshaman.cf
fi
hdir=`date +$DATA/%Y/%m/%d/%H`
mkdir -p $hdir
cd $hdir || exit -1 # better not to do anything
port=$SIP_PORT # sip service port start
mport=$MEDIA_PORT # rtp service port start
export IFS=";"
addr=`/sbin/ifconfig eth0| perl -ne 'print $1 if /inet addr:(\d+\.\d+\.\d+\.\d+)/'`
while read server service outproxy function machine calls; do
if test -z "$server"; then
continue
fi
if test -z "$outproxy"; then
outproxy="outgoing-proxy-missing"
fi
if test -z "$calls" ; then
calls=1
fi
echo $server | egrep -q '^\s*#'
if test $? = 1 ; then # no comment
/usr/bin/sipp $server -s $service -i $addr -sf $CONF/$CLIENT_SCENARIO -p $port -mp $mport -m $calls -rp 200000 -l 1 -trace_stat -fd 99999 -trace_logs -trace_msg -trace_err -bg -nofork -rsa $outproxy 2>> sipp.err >> sipp.log &
server_ip=`echo $server| sed -e 's/:.*//'`
# echo server_ip $server_ip
echo `date "+%F %T"` $pid $port $mport $service@$server $function $machine `ping -c 10 -i 0.5 -q $server_ip | awk -F / '/^rtt /{print $5}'`>> task.log
# time=$y-$m-$d-$h
# perl -e "dbmopen(%tests, 'sip-test.dbm',0622); \$tests\{$time,$pid\}=$adr;dbmclose(%tests)"