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){ ...@@ -145,6 +145,8 @@ foreach $tasklog(@ARGV){
# system($cmd); # || die "command failed : $cmd : $!"; # system($cmd); # || die "command failed : $cmd : $!";
$xml = XMLin($tmp) || die "Could not analyze XML $tmp : $!"; $xml = XMLin($tmp) || die "Could not analyze XML $tmp : $!";
print Dumper($xml) if $opt_dump; print Dumper($xml) if $opt_dump;
unlink $tmp;
my @flow=(); my @flow=();
if (ref($xml->{flow}) eq "ARRAY"){ if (ref($xml->{flow}) eq "ARRAY"){
...@@ -179,7 +181,6 @@ foreach $tasklog(@ARGV){ ...@@ -179,7 +181,6 @@ foreach $tasklog(@ARGV){
unlink $tmp;
exit(0); exit(0);
sub bb_color { sub bb_color {
......
...@@ -9,18 +9,9 @@ else ...@@ -9,18 +9,9 @@ else
source /etc/sipshaman/sipshaman.cf source /etc/sipshaman/sipshaman.cf
fi fi
y=`date +%Y` hdir=`date +$DATA/%Y/%m/%d/%H`
m=`date +%m`
d=`date +%d`
h=`date +%H`
ydir=$DATA/$y
mdir=$ydir/$m
ddir=$mdir/$d
hdir=$ddir/$h
cd $hdir 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 ...@@ -32,23 +32,9 @@ if test $# -gt 0; then
shift shift
fi fi
y=`date +%Y` hdir=`date +$DATA/%Y/%m/%d/%H`
m=`date +%m` mkdir -p $hdir
d=`date +%d` cd $hdir || exit -1 # better not to do anything
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
$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 $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 ...@@ -34,36 +34,29 @@ fi
ps -ef | egrep -q "$BIN/[s]ipp .*-p $SIP_PORT" - ps -ef | egrep -q "$BIN/[s]ipp .*-p $SIP_PORT" -
if test $? = 1 ; then # not found if test $? = 1 ; then # not found
y=`date +%Y` hdir=`date +$DATA/%Y/%m/%d/%H`
m=`date +%m` mkdir -p $hdir
d=`date +%d` cd $hdir || exit -1 # better not to do anything
h=`date +%H`
t1=`date +%s`
ydir=$DATA/$y t1=`date +%s`
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
port=$SIP_PORT port=$SIP_PORT
mport=$MEDIA_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 & $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=$! pid=$!
echo $y-$m-$d `date +%T` $pid $port $mport sipp@$iaddr $REPORT_TAG `hostname --fqdn` 0 >> task.log echo $y-$m-$d `date +%T` $pid $port $mport sipp@$iaddr $REPORT_TAG `hostname --fqdn` 0 >> task.log
wait $pid
t2=`date +%s` t2=`date +%s`
dt=$(($t2-$t1)) dt="$(($t2-$t1))"
if test $dt -lt 5; then # if test $dt -lt 5; then #
echo #### too short interval $dt | mail -s sipp-responder oak@uninett.no echo #### too short interval $dt for pid $pid >> sipp.err
exit 1 # exit 1
fi fi
fi fi
......
...@@ -11,24 +11,10 @@ else ...@@ -11,24 +11,10 @@ else
source /etc/sipshaman/sipshaman.cf source /etc/sipshaman/sipshaman.cf
fi fi
y=`date +%Y` hdir=`date +$DATA/%Y/%m/%d/%H`
m=`date +%m` mkdir -p $hdir
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
cd $hdir || exit -1 # better not to do anything cd $hdir || exit -1 # better not to do anything
port=$SIP_PORT # sip service port start port=$SIP_PORT # sip service port start
mport=$MEDIA_PORT # rtp service port start mport=$MEDIA_PORT # rtp service port start
export IFS=";" 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