#!/bin/sh
# This regression test is a part of SIPp.
# A scenario that plays both an apattern and an rtp_stream file loads,
# and plays both in each call: the UAS echoes the pattern intact.
. "`dirname "$0"`/../functions"; init

head -c 1600 /dev/zero | tr '\0' '\377' >silence.ulaw
sippbg -sf uas.xml -i 127.0.0.1 -p 26100 -m 3 \
    -min_rtp_port 28200 -max_rtp_port 28399
sippfg -sf uac.xml -i 127.0.0.1 -p 26101 -m 3 -l 1 \
    -min_rtp_port 28000 -max_rtp_port 28199 -audiotolerance 0.2 \
    127.0.0.1:26100 -timeout 10 -timeout_error >/dev/null 2>&1
status=$?
rm -f silence.ulaw

if test $status -ne 0; then
    fail "UAC failed with $status"
else
    ok
fi
