Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Changes in 3.6.0
================

* Removed unused RTPStream code concerning video streams. Also
consolidated the rtpstream audio port usage to reuse the global
`[media_port]` instead of the `[rtpstream_audio_port]`.
Also the `-min_rtp_port` and `-max_rtp_port` options have been
removed. Advantages: cleaner code, fewer scenario variables.
Drawbacks: possible ICMP port unreachable messages for RCTP and video.
Also, no easy way to discern different streams if you want to bombard
a single UAS with multiple RTP streams. (Issue #192, reported by
@atsakiridis.)


Bugs fixed in 3.5.1
===================

Expand Down
2 changes: 0 additions & 2 deletions include/sipp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ extern int tcp_readsize _DEFVAL(65535);
extern int hasMedia _DEFVAL(0);
#endif
#ifdef RTP_STREAM
extern int min_rtp_port _DEFVAL(DEFAULT_MIN_RTP_PORT);
extern int max_rtp_port _DEFVAL(DEFAULT_MAX_RTP_PORT);
extern int rtp_default_payload _DEFVAL(DEFAULT_RTP_PAYLOAD);
extern int rtp_tasks_per_thread _DEFVAL(DEFAULT_RTP_THREADTASKS);
extern int rtp_buffsize _DEFVAL(65535);
Expand Down
Binary file added regress/github-#0196/beep_1sec_50x160b.alaw
Binary file not shown.
32 changes: 32 additions & 0 deletions regress/github-#0196/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 -mp $uac_media_port \
-timeout 5 -timeout_error >/dev/null 2>&1
status=$?

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

port=`sed -e '/^Connection 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
80 changes: 80 additions & 0 deletions regress/github-#0196/uac.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="oinv-i200-ibye.xml -- wjd 2014">

<send retrans="500" start_txn="invite">
<![CDATA[

INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: sip:[service]@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
To: sip:[service]@[remote_ip]:[remote_port]
Call-ID: [call_id]
CSeq: [cseq] INVITE
Contact: sip:[service]@[local_ip]:[local_port]
Content-Type: application/sdp
Content-Length: [len]

v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 8 0
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000

]]>
</send>

<recv response="100" optional="true" response_txn="invite"/>

<recv response="180" optional="true" response_txn="invite"/>

<recv response="183" optional="true" response_txn="invite"/>

<recv response="200" rrs="true" response_txn="invite"/>

<send ack_txn="invite">
<![CDATA[

ACK [next_url] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
[routes]
From: sip:[service]@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
To: sip:[service]@[remote_ip]:[remote_port][peer_tag_param]
Call-ID: [call_id]
CSeq: [cseq] ACK
Contact: sip:[service]@[local_ip]:[local_port]
Content-Length: 0

]]>
</send>

<!-- Send some audio to avoid rtptimeout timers kicking in. -->
<nop>
<action>
<exec rtp_stream="beep_1sec_50x160b.alaw,-1,8"/>
</action>
</nop>

<recv request="BYE"/>

<send>
<![CDATA[

SIP/2.0 200 OK
[last_Via:]
[last_Record-Route:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Content-Length: 0

]]>
</send>

<timewait milliseconds="1000"/><!-- retransmit 200's for a while -->

</scenario>
78 changes: 78 additions & 0 deletions regress/github-#0196/uas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="iinv-o200-obye.xml -- wjd 2014">

<recv request="INVITE" rrs="true"/>

<send>
<![CDATA[

SIP/2.0 180 Ringing
[last_Via:]
[last_Record-Route:]
[last_From:]
[last_To:];tag=[pid]SIPpTag01[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: sip:[service]@[local_ip]:[local_port]
Content-Length: 0

]]>
</send>

<send retrans="500">
<![CDATA[

SIP/2.0 200 OK
[last_Via:]
[last_Record-Route:]
[last_From:]
[last_To:];tag=[pid]SIPpTag01[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: sip:[service]@[local_ip]:[local_port]
Content-Type: application/sdp
Content-Length: [len]

v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [custom_media_port] RTP/AVP 8 0
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000

]]>
</send>

<recv request="ACK" rrs="true">
<action>
<ereg regexp=": *(.*)" search_in="hdr" header="To" assign_to="_,us"/><!-- with tag -->
<ereg regexp=": *(.*)" search_in="hdr" header="From" assign_to="_,them"/>
</action>
</recv>
<Reference variables="_"/>

<!-- Wait for the other side to send some RTP -->
<pause milliseconds="1000"/>

<send start_txn="bye" retrans="500">
<![CDATA[

BYE [next_url] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
[routes]
From: [$us]
To: [$them]
[last_Call-ID:]
CSeq: [cseq] BYE
Contact: sip:[service]@[local_ip]:[local_port]
Content-Length: 0

]]>
</send>

<recv response="200" response_txn="bye"/>

</scenario><!-- vim: set ts=8 sw=2 sts=2 et ai: -->
24 changes: 4 additions & 20 deletions src/call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2182,26 +2182,10 @@ char* call::createSendingMessage(SendingMessage *src, int P_index, char *msg_buf
break;
}
#ifdef RTP_STREAM
case E_Message_RTPStream_Audio_Port:
{
int temp_audio_port= rtpstream_get_audioport (&rtpstream_callinfo);
if (!temp_audio_port) {
/* Make this a warning instead? */
ERROR("cannot assign a free audio port to this call - using 0 for [rtpstream_audio_port]");
}
dest += snprintf(dest, left, "%d",temp_audio_port);
}
break;
case E_Message_RTPStream_Video_Port:
{
int temp_video_port= rtpstream_get_videoport (&rtpstream_callinfo);
if (!temp_video_port) {
/* Make this a warning instead? */
ERROR("cannot assign a free video port to this call - using 0 for [rtpstream_video_port]");
}
dest += snprintf(dest, left, "%d",temp_video_port);
}
break;
case E_Message_RTPStream_Audio_Port: /* DEPRECATED */
case E_Message_RTPStream_Video_Port: /* DEPRECATED */
dest += sprintf(dest, "%u", media_port);
break;
#endif
case E_Message_Media_IP_Type:
dest += snprintf(dest, left, "%s", (media_ip_is_ipv6 ? "6" : "4"));
Expand Down
5 changes: 3 additions & 2 deletions src/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ struct KeywordMap SimpleKeywords[] = {
{"auto_media_port", E_Message_Auto_Media_Port },
#endif
#ifdef RTP_STREAM
{"rtpstream_audio_port", E_Message_RTPStream_Audio_Port },
{"rtpstream_video_port", E_Message_RTPStream_Video_Port },
/* Legacy since 3.6-dev. Actually uses media_port. */
{"rtpstream_audio_port", E_Message_RTPStream_Audio_Port },
{"rtpstream_video_port", E_Message_RTPStream_Video_Port },
#endif
{"media_port", E_Message_Media_Port },
{"media_ip_type", E_Message_Media_IP_Type },
Expand Down
Loading