diff --git a/functions b/functions index 944473b..d0ad733 100755 --- a/functions +++ b/functions @@ -64,13 +64,14 @@ fail_rc() { } case "${RTPPC_TYPE}" in - "udp") RTPP_SOCK_TEST="${RTPP_SOCK_UDP}";; - "udp6") RTPP_SOCK_TEST="${RTPP_SOCK_UDP6}";; - "unix") RTPP_SOCK_TEST="${RTPP_SOCK_UNIX}";; - "cunix") RTPP_SOCK_TEST="${RTPP_SOCK_CUNIX}";; - "tcp") RTPP_SOCK_TEST="${RTPP_SOCK_TCP}";; - "tcp6") RTPP_SOCK_TEST="${RTPP_SOCK_TCP6}";; - *) fail_rc 1 "Unknown socket type RTPPC_TYPE=${RTPPC_TYPE}";; + "udp") RTPP_SOCK_TEST="${RTPP_SOCK_UDP}";; + "udp6") RTPP_SOCK_TEST="${RTPP_SOCK_UDP6}";; + "unix") RTPP_SOCK_TEST="${RTPP_SOCK_UNIX}";; + "cunix") RTPP_SOCK_TEST="${RTPP_SOCK_CUNIX}";; + "tcp") RTPP_SOCK_TEST="${RTPP_SOCK_TCP}";; + "tcp6") RTPP_SOCK_TEST="${RTPP_SOCK_TCP6}";; + "rtp.io") RTPP_SOCK_TEST="${RTPP_SOCK_TCP}";; + *) fail_rc 1 "Unknown socket type RTPPC_TYPE=${RTPPC_TYPE}";; esac MM_INIT_DELAY=1 diff --git a/scenarios/simple/opensips.cfg.in b/scenarios/simple/opensips.cfg.in index 13396ee..354ce10 100644 --- a/scenarios/simple/opensips.cfg.in +++ b/scenarios/simple/opensips.cfg.in @@ -16,6 +16,9 @@ loadmodule "sl/sl.so" loadmodule "tm/tm.so" loadmodule "rr/rr.so" loadmodule "maxfwd/maxfwd.so" +#if RTPPC_TYPE == rtp.io +loadmodule "rtp.io/rtp.io.so" +#endif loadmodule "rtpproxy/rtpproxy.so" loadmodule "textops/textops.so" #if !(OPENSIPS_VER_FULL == master || OPENSIPS_VER >= 30) @@ -29,7 +32,11 @@ loadmodule "uri/uri.so" #define SRC_PORT $sp #define STATUS $rs +#if RTPPC_TYPE == rtp.io +modparam("rtp.io", "rtpproxy_args", "-s tcp:127.0.0.1:22222 -m 12000 -M 15000 -6 /:: -l 0.0.0.0") +#else modparam("rtpproxy", "rtpproxy_sock", RTPP_SOCK_TEST) +#endif listen=udp:127.0.0.1:5060 listen=udp:[::1]:5060 diff --git a/test_run.sh b/test_run.sh index b6cd187..c913f34 100755 --- a/test_run.sh +++ b/test_run.sh @@ -70,7 +70,7 @@ start_mm() { MM_CFG="opensips.cfg" MM_BIN="${MM_ROOT}/opensips" pp_file "scenarios/${MM_AUTH}/${MM_CFG}.in" -DRTPP_SOCK_TEST=\"${RTPP_SOCK_TEST}\" -DOPENSIPS_VER=${MM_VER} \ - -DOPENSIPS_VER_FULL=${MM_VER_FULL} -DMM_AUTH="${MM_AUTH}" -DMM_ROOT="${MM_ROOT}" + -DOPENSIPS_VER_FULL=${MM_VER_FULL} -DMM_AUTH="${MM_AUTH}" -DMM_ROOT="${MM_ROOT}" -DRTPPC_TYPE="${RTPPC_TYPE}" for nret in 0 1 2 do PP_SUF=".nr${nret}" pp_file scenarios/${MM_AUTH}/rtpproxy.opensips.output.in -DOPENSIPS_VER=${MM_VER} \ @@ -172,22 +172,26 @@ export RTPP_LOG_TSTART RTPP_LOG_TFORM="rel" export RTPP_LOG_TFORM -rtpproxy_cmds_gen | ${RTPPROXY} -p "${RTPP_PIDF}" -d dbug -F -f -s stdio: -s "${RTPP_SOCK_UDP}" \ - -s "${RTPP_SOCK_CUNIX}" -s "${RTPP_SOCK_UNIX}" -s "${RTPP_SOCK_UDP6}" -s "${RTPP_SOCK_TCP}" \ - -s "${RTPP_SOCK_TCP6}" -m 12000 -M 15000 -6 '/::' -l '0.0.0.0' ${RTPP_NOTIFY_ARG} > rtpproxy.rout 2>rtpproxy.log & -RTPP_PID=${!} -sleep 1 -i=0 -while [ ! -e "${RTPP_SOCK_BARE}" ] -do - if [ ${i} -gt 4 ] - then - report_rc_log 1 "rtpproxy.rout rtpproxy.log" "Waiting for the RTPproxy to become ready" - fi +if [ "${RTPPC_TYPE}" != "rtp.io" ] +then + rtpproxy_cmds_gen | ${RTPPROXY} -p "${RTPP_PIDF}" -d dbug -F -f -s stdio: -s "${RTPP_SOCK_UDP}" \ + -s "${RTPP_SOCK_CUNIX}" -s "${RTPP_SOCK_UNIX}" -s "${RTPP_SOCK_UDP6}" -s "${RTPP_SOCK_TCP}" \ + -s "${RTPP_SOCK_TCP6}" -m 12000 -M 15000 -6 '/::' -l '0.0.0.0' ${RTPP_NOTIFY_ARG} > rtpproxy.rout 2>rtpproxy.log & + RTPP_PID=${!} sleep 1 - i=$((${i} + 1)) -done -sleep 1 + i=0 + while [ ! -e "${RTPP_SOCK_BARE}" ] + do + if [ ${i} -gt 4 ] + then + report_rc_log 1 "rtpproxy.rout rtpproxy.log" "Waiting for the RTPproxy to become ready" + fi + sleep 1 + i=$((${i} + 1)) + done + sleep 1 +fi + start_mm MM_AUTH="${MM_AUTH}" ${PYTHON_CMD} alice.py "${ALICE_ARGS}" -t "${TEST_SET}" -l '*' -P 5061 \ -T ${ALICE_TIMEOUT} 2>alice.log & @@ -219,10 +223,15 @@ then # before we SIGHUP it ${PYTHON_CMD} -c "from time import time, sleep; tleft=${SIPLOG_TSTART} + ${RTPP_STAT_TIMEOUT} + 5 - time(); sleep(tleft) if tleft > 0 else False;" fi -kill -HUP ${RTPP_PID} -echo "RTPP_PID: ${RTPP_PID}" -wait ${RTPP_PID} -RTPP_RC="${?}" +if [ "${RTPPC_TYPE}" != "rtp.io" ] +then + kill -HUP ${RTPP_PID} + echo "RTPP_PID: ${RTPP_PID}" + wait ${RTPP_PID} + RTPP_RC="${?}" +else + RTPP_RC=0 +fi rm -f "${ALICE_PIDF}" "${BOB_PIDF}"