|
@@ -1,4 +1,4 @@
|
|
|
-#!/bin/bash
|
|
|
+#!/bin/sh
|
|
|
# configuration with pseudo-variables, transformations and xlog output
|
|
|
|
|
|
# Copyright (C) 2007 1&1 Internet AG
|
|
@@ -29,24 +29,28 @@ if ! (check_netcat && check_kamailio); then
|
|
|
exit 0
|
|
|
fi ;
|
|
|
|
|
|
-$BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG &> $TMPFILE
|
|
|
+$BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG -a no > $TMPFILE 2>&1
|
|
|
ret=$?
|
|
|
|
|
|
-sleep 1
|
|
|
+if ( have_netcat_quit_timer_patch ); then
|
|
|
+ NCOPTS='-q 1'
|
|
|
+else
|
|
|
+ NCOPTS='-w 1'
|
|
|
+fi
|
|
|
|
|
|
+sleep 1
|
|
|
|
|
|
if [ "$ret" -eq 0 ] ; then
|
|
|
# register a user
|
|
|
- cat register.sip | nc -q 1 -u localhost 5060 > /dev/null
|
|
|
- $CTL ul show | grep "AOR:: 1000" > /dev/null
|
|
|
+ cat register.sip | nc $NCOPTS -u localhost 5060 > /dev/null
|
|
|
+ $CTL ul show | grep '"AoR":"1000"' > /dev/null
|
|
|
ret=$?
|
|
|
# unregister the user
|
|
|
- cat unregister.sip | nc -q 1 -u localhost 5060 > /dev/null
|
|
|
+ cat unregister.sip | nc $NCOPTS -u localhost 5060 > /dev/null
|
|
|
fi ;
|
|
|
|
|
|
-
|
|
|
if [ "$ret" -eq 0 ] ; then
|
|
|
- $CTL ul show | grep "AOR:: 1000" > /dev/null
|
|
|
+ $CTL ul show | grep '"AoR":"1000"' > /dev/null
|
|
|
ret=$?
|
|
|
if [ "$ret" -eq 0 ] ; then
|
|
|
ret=1
|
|
@@ -83,7 +87,7 @@ if [ "$ret" -eq 0 ] ; then
|
|
|
fi ;
|
|
|
fi ;
|
|
|
fi ;
|
|
|
-cat $TMPFILE
|
|
|
+
|
|
|
kill_kamailio
|
|
|
rm $TMPFILE
|
|
|
|