diff --git a/test/unit/12.cfg b/test/unit/12.cfg index e593d95504b..7560b6eb65b 100644 --- a/test/unit/12.cfg +++ b/test/unit/12.cfg @@ -10,8 +10,9 @@ loadmodule "xlog" loadmodule "usrloc" loadmodule "registrar" loadmodule "pv" -loadmodule "mi_fifo" -modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo") +loadmodule "jsonrpcs" +modparam("jsonrpcs", "transport", 2) +modparam("jsonrpcs", "fifo_name", "kamailio_rpc.fifo") request_route { xlog("received by kamailio[$pp] at '$Tf' from $si:$sp, method: $(rm{s.tolower}), transport: $rP:$Ri:$rp, user agent: $ua\n"); diff --git a/test/unit/12.sh b/test/unit/12.sh index 78f808496cc..adde1d7138c 100755 --- a/test/unit/12.sh +++ b/test/unit/12.sh @@ -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