Commit df53ed8a authored by Olav Kvittem's avatar Olav Kvittem

sipp-responder waits for sipp


git-svn-id: file:///home/svn/sipshaman/trunk@21 9383e1fa-a92b-456e-b4ec-45f0d4f7abeb
parent 31845d77
......@@ -145,6 +145,8 @@ foreach $tasklog(@ARGV){
# system($cmd); # || die "command failed : $cmd : $!";
$xml = XMLin($tmp) || die "Could not analyze XML $tmp : $!";
print Dumper($xml) if $opt_dump;
unlink $tmp;
my @flow=();
if (ref($xml->{flow}) eq "ARRAY"){
......@@ -179,7 +181,6 @@ foreach $tasklog(@ARGV){
unlink $tmp;
exit(0);
sub bb_color {
......
......@@ -9,18 +9,9 @@ else
source /etc/sipshaman/sipshaman.cf
fi
y=`date +%Y`
m=`date +%m`
d=`date +%d`
h=`date +%H`
ydir=$DATA/$y
mdir=$ydir/$m
ddir=$mdir/$d
hdir=$ddir/$h
hdir=`date +$DATA/%Y/%m/%d/%H`
cd $hdir
$BIN/qstream-sipp-check $* -bb $BB_HOST -f -die 59 task.log
$BIN/qstream-sipp-check $* -bb $BB_HOST -f -die 59 task.log
......@@ -32,23 +32,9 @@ if test $# -gt 0; then
shift
fi
y=`date +%Y`
m=`date +%m`
d=`date +%d`
h=`date +%H`
t1=`date +%s`
ydir=$DATA/$y
test -d $ydir || mkdir $ydir
mdir=$ydir/$m
test -d $mdir || mkdir $mdir
ddir=$mdir/$d
test -d $ddir || mkdir $ddir
hdir=$ddir/$h
test -d $hdir || mkdir $hdir
cd $hdir
hdir=`date +$DATA/%Y/%m/%d/%H`
mkdir -p $hdir
cd $hdir || exit -1 # better not to do anything
$BIN/sipp $registrar:$SIP_PROXY_PORT -s $SIPP_USER -i $interf -p $REGISTER_PORT -l 1 -m 1 -sf $CONF/register.xml -trace_err -trace_msg -inf $CONF/register-name.txt -bg
......@@ -34,36 +34,29 @@ fi
ps -ef | egrep -q "$BIN/[s]ipp .*-p $SIP_PORT" -
if test $? = 1 ; then # not found
y=`date +%Y`
m=`date +%m`
d=`date +%d`
h=`date +%H`
t1=`date +%s`
hdir=`date +$DATA/%Y/%m/%d/%H`
mkdir -p $hdir
cd $hdir || exit -1 # better not to do anything
ydir=$DATA/$y
test -d $ydir || mkdir $ydir
mdir=$ydir/$m
test -d $mdir || mkdir $mdir
ddir=$mdir/$d
test -d $ddir || mkdir $ddir
hdir=$ddir/$h
test -d $hdir || mkdir $hdir
cd $hdir
t1=`date +%s`
port=$SIP_PORT
mport=$MEDIA_PORT
idle_time=$((60-`date +%M`-1)) # end just before every hour if now response
# end just 3 sec before every hour if now response (millisec)
idle_time="$(((60-`date +%M|sed -e s/^0//`)*60000+(60-`date +%S|sed -e s/^0//`-3)*1000))"
$BIN/sipp $proxy:$SIP_PROXY_PORT -s sipp -i $iaddr -p $port -mp $mport -recv_timeout $idle_time -l 1 -m 1 -sf $CONF/$RESPONDER_SCENARIO -trace_stat -trace_logs -trace_err -trace_msg -rp 600000 -r 1 -bg -nofork 2>> sipp.err >> sipp.log &
pid=$!
echo $y-$m-$d `date +%T` $pid $port $mport sipp@$iaddr $REPORT_TAG `hostname --fqdn` 0 >> task.log
wait $pid
t2=`date +%s`
dt=$(($t2-$t1))
dt="$(($t2-$t1))"
if test $dt -lt 5; then #
echo #### too short interval $dt | mail -s sipp-responder oak@uninett.no
exit 1
echo #### too short interval $dt for pid $pid >> sipp.err
# exit 1
fi
fi
......
......@@ -11,24 +11,10 @@ else
source /etc/sipshaman/sipshaman.cf
fi
y=`date +%Y`
m=`date +%m`
d=`date +%d`
h=`date +%H`
ydir=$DATA/$y
test -d $ydir || mkdir $ydir
mdir=$ydir/$m
test -d $mdir || mkdir $mdir
ddir=$mdir/$d
test -d $ddir || mkdir $ddir
hdir=$ddir/$h
test -d $hdir || mkdir $hdir
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=";"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment