File: run

package info (click to toggle)
sip-tester 1%3A3.7.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,932 kB
  • sloc: cpp: 29,383; xml: 13,436; ansic: 2,381; python: 2,218; sh: 505; makefile: 13
file content (32 lines) | stat: -rwxr-xr-x 951 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# This regression test is a part of SIPp.
# Author: Walter Doekes, OSSO B.V., 2016
#
# Similar to github-#0192, it checks whether the rtpstream source port
# is correct, but this time uses the [media_port] instead of a special
# [rtpstream_audio_port].
#
. "`dirname "$0"`/../functions"; init

uac_media_port=5072  # client port
uas_media_port=5071  # server port

udplisten $uas_media_port >udplisten.log &
udplisten_job=$!
trap "kill -9 $udplisten_job 2>/dev/null" EXIT

sippbg -sf uas.xml -p 5070 -key custom_media_port $uas_media_port
sippfg -m 1 -sf uac.xml 127.0.0.1:5070 -min_rtp_port $uac_media_port \
    -timeout 5 -timeout_error >/dev/null 2>&1
status=$?

test $status -ne 0 && fail "SIPp UAC job failed"

port=`sed -e '/^Connectionless from/!d;s/.*://' udplisten.log`
if test "$port" = "$uac_media_port"; then
    ok
elif test -n "$port"; then
    fail "got RTP from wrong source port $port"
else
    fail "got no RTP at all"
fi