Commit f05aa72f authored by Olav Kvittem's avatar Olav Kvittem

added SIP_INTERFACE which sipp listens to in config


git-svn-id: file:///home/svn/sipshaman/trunk@39 9383e1fa-a92b-456e-b4ec-45f0d4f7abeb
parent 173d9f52
......@@ -9,21 +9,32 @@ else
source /etc/sipshaman/sipshaman.cf
fi
while test 1=1 ; do
ps -ef | egrep -q "$BIN/qstream-[s]ipp-check .*-bb $BB_HOST" -
while test 1=1 ; do
if test -n $SIP_INTERFACE ; then
/sbin/ifconfig | grep -q $SIP_INTERFACE
ifdown=$?
else
ifdown=0
fi
if test $? = 1; then # not found
ps -ef | egrep -q "$BIN/qstream-[s]ipp-check .*-bb $BB_HOST" -
progabsent=$?
hdir=`date +$DATA/%Y/%m/%d/%H`
if test $ifdown -eq 0 ; then # found
if test $progabsent -eq 1 ; then #
hdir=`date +$DATA/%Y/%m/%d/%H`
if test -d $hdir; then
cd $hdir
if test -s task.log; then # do not start until any data
lifemin="$((60-`date +%M|sed -e s/^0//`))"
$BIN/qstream-sipp-check $* -v -xml -bb $BB_HOST -f -die $lifemin task.log
sleep 3
fi
fi
sleep 3
done
fi
fi
sleep 3
done
......@@ -10,11 +10,22 @@ else
source /etc/sipshaman/sipshaman.cf
fi
registrar=`/sbin/ifconfig eth0| perl -ne 'print $1 if /inet addr:(\d+\.\d+\.\d+\.\d+)/'`
interf=$registrar
if test .$SIP_INTERFACE != . ; then
/sbin/ifconfig | grep -q $SIP_INTERFACE
if test $? -eq 1; then # not found
exit 0 ##### exit ######
else
interf=$SIP_INTERFACE
fi
else
interf=`/sbin/ifconfig eth0| perl -ne 'print $1 if /inet addr:(\d+\.\d+\.\d+\.\d+)/'`
fi
if test .$SIP_PROXY = .; then
registrar=$SIP_PROXY
else
registrar=$interf
fi
if test .$1 = .-h; then
......
......@@ -30,7 +30,16 @@ if test $# -gt 0; then
shift
fi
while test 1=1 ; do
while test 1=1 ; do
if test .$SIP_INTERFACE != . ; then
iaddr=$SIP_INTERFACE
/sbin/ifconfig | grep -q $SIP_INTERFACE
if test $? -eq 1; then # not found
sleep 3
continue ##### exit ######
fi
fi
ps -ef | egrep -q "$BIN/[s]ipp .*-p $SIP_PORT" -
if test $? = 1 ; then # not found
......@@ -40,7 +49,7 @@ fi
t1=`date +%s`
port=$SIP_PORT
mport=$MEDIA_PORT
mport=$MEDIA_PORT
# 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))"
......@@ -63,4 +72,4 @@ fi
sleep 3
done
done
......@@ -10,7 +10,7 @@ fi
for cf in $*; do
source $cf
ps axw | grep -q "sh .*/usr/bin/sipp-b[b].*$cf" -
ps axw | egrep -q "sh .*/usr/bin/sipp-b[b].*$cf" -
if test $? -eq 1; then # not found and ok to run
$BIN/sipp-bb -cf $cf&
fi
......
......@@ -9,10 +9,11 @@ if test $# -le 0; then
fi
for cf in $*; do
source $cf
ps axw | grep -q "sh .*/usr/bin/sipp-responde[r].*$cf" -
if test $? -eq 1; then # not found and ok to run
$BIN/sipp-responder -cf $cf&
fi
source $cf
ps axw | grep -q "sh .*/usr/bin/sipp-responde[r].*$cf" -
if test $? -eq 1; then # not found and ok to run
$BIN/sipp-responder -cf $cf&
fi
done
\ No newline at end of file
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