Skip to content
Open
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
10 changes: 8 additions & 2 deletions include/rtpstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,14 @@ int rtpstream_new_call(rtpstream_callinfo_t *callinfo);
void rtpstream_end_call(rtpstream_callinfo_t *callinfo);
int rtpstream_shutdown(std::unordered_map<pthread_t, std::string>& threadIDs);

int rtpstream_get_local_audioport(rtpstream_callinfo_t *callinfo);
int rtpstream_get_local_videoport(rtpstream_callinfo_t *callinfo);
int rtpstream_get_local_uac_audioport(rtpstream_callinfo_t *callinfo);
int rtpstream_get_local_uac_videoport(rtpstream_callinfo_t *callinfo);
int rtpstream_rotate_local_uac_audioport(rtpstream_callinfo_t *callinfo, int newPort);
int rtpstream_rotate_local_uac_videoport(rtpstream_callinfo_t *callinfo, int newPort);
int rtpstream_get_local_uas_audioport(rtpstream_callinfo_t *callinfo);
int rtpstream_get_local_uas_videoport(rtpstream_callinfo_t *callinfo);
int rtpstream_rotate_local_uas_audioport(rtpstream_callinfo_t *callinfo, int newPort);
int rtpstream_rotate_local_uas_videoport(rtpstream_callinfo_t *callinfo, int newPort);
void rtpstream_set_remote(rtpstream_callinfo_t* callinfo, int ip_ver, const char* ip_addr,
int audio_port, int video_port);

Expand Down
21 changes: 15 additions & 6 deletions include/sipp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ cmd messages are received */
#define DEFAULT_RATE_PERIOD_MS 1000
#define DEFAULT_TRANSPORT T_UDP
#define DEFAULT_PORT 5060
#define DEFAULT_MEDIA_PORT 6000
#define DEFAULT_3PCC_PORT 6060
#define DEFAULT_SERVICE "service"
#define DEFAULT_AUTH_PASSWORD "password"
Expand All @@ -172,8 +171,12 @@ cmd messages are received */

#define DEFAULT_BEHAVIOR_ALL (DEFAULT_BEHAVIOR_BYE | DEFAULT_BEHAVIOR_ABORTUNEXP | DEFAULT_BEHAVIOR_PINGREPLY | DEFAULT_BEHAVIOR_BADCSEQ)

#define DEFAULT_MIN_RTP_PORT DEFAULT_MEDIA_PORT
#define DEFAULT_MAX_RTP_PORT 65535
#define DEFAULT_MIN_RTP_AUDIO_PORT 20000
#define DEFAULT_MAX_RTP_AUDIO_PORT 20998
#define DEFAULT_MIN_RTP_VIDEO_PORT 30000
#define DEFAULT_MAX_RTP_VIDEO_PORT 30998
#define DEFAULT_MIN_UDP_IMAGE_PORT 40000
#define DEFAULT_MAX_UDP_IMAGE_PORT 40998
#define DEFAULT_RTP_PAYLOAD 8
#define DEFAULT_RTP_THREADTASKS 20

Expand Down Expand Up @@ -251,8 +254,12 @@ MAYBE_EXTERN int control_port DEFVAL(0);
MAYBE_EXTERN int buff_size DEFVAL(65536);
MAYBE_EXTERN int tcp_readsize DEFVAL(65536);
MAYBE_EXTERN int hasMedia DEFVAL(0);
MAYBE_EXTERN int min_rtp_port DEFVAL(DEFAULT_MIN_RTP_PORT);
MAYBE_EXTERN int max_rtp_port DEFVAL(DEFAULT_MAX_RTP_PORT);
MAYBE_EXTERN int min_rtp_audio_port DEFVAL(DEFAULT_MIN_RTP_AUDIO_PORT);
MAYBE_EXTERN int max_rtp_audio_port DEFVAL(DEFAULT_MAX_RTP_AUDIO_PORT);
MAYBE_EXTERN int min_rtp_video_port DEFVAL(DEFAULT_MIN_RTP_VIDEO_PORT);
MAYBE_EXTERN int max_rtp_video_port DEFVAL(DEFAULT_MAX_RTP_VIDEO_PORT);
MAYBE_EXTERN int min_udp_image_port DEFVAL(DEFAULT_MIN_UDP_IMAGE_PORT);
MAYBE_EXTERN int max_udp_image_port DEFVAL(DEFAULT_MAX_UDP_IMAGE_PORT);
MAYBE_EXTERN int rtp_default_payload DEFVAL(DEFAULT_RTP_PAYLOAD);
MAYBE_EXTERN int rtp_tasks_per_thread DEFVAL(DEFAULT_RTP_THREADTASKS);
MAYBE_EXTERN int rtp_buffsize DEFVAL(65536);
Expand All @@ -265,7 +272,9 @@ MAYBE_EXTERN double videotolerance DEFVAL(1.0);

MAYBE_EXTERN bool rtp_echo_enabled DEFVAL(0);
MAYBE_EXTERN char media_ip[127]; /* also used for hostnames */
MAYBE_EXTERN int media_port DEFVAL(0);
MAYBE_EXTERN int media_audio_port DEFVAL(0);
MAYBE_EXTERN int media_video_port DEFVAL(0);
MAYBE_EXTERN int media_image_port DEFVAL(0);
MAYBE_EXTERN size_t media_bufsize DEFVAL(2048);
MAYBE_EXTERN bool media_ip_is_ipv6 DEFVAL(false);
MAYBE_EXTERN char remote_ip[127]; /* also used for hostnames */
Expand Down
2 changes: 1 addition & 1 deletion regress/github-#0196/run
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ 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 \
sippfg -m 1 -sf uac.xml 127.0.0.1:5070 -min_rtp_audio_port $uac_media_port \
-timeout 5 -timeout_error >/dev/null 2>&1
status=$?

Expand Down
2 changes: 1 addition & 1 deletion regress/github-#0276/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ udplisten 6002 >tmp.log 2>&1 &
listenjob=$!

sippbg -sn uas -i 127.0.0.1 -p 5070 -m 1 \
-min_rtp_port 6200 # media port at 6200
-min_rtp_audio_port 6200 # audio media port at 6200
sippfg -sn uac -i 127.0.0.1 -m 1 127.0.0.1:5070 >uac.log 2>&1
fgok=$?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [rtpstream_audio_port] RTP/AVP 0 18 9 103 8 101
a=rtcp:[rtpstream_audio_port+1]
a=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio]
a=crypto:[cryptotag2audio] [cryptosuiteaescm128sha1322audio] inline:[cryptokeyparams2audio]
a=rtcp:[rtpstream_audio_port+1]
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
Expand Down Expand Up @@ -137,9 +137,9 @@
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [rtpstream_audio_port] RTP/AVP 0 18 9 103 8 101
a=rtcp:[rtpstream_audio_port+1]
a=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio]
a=crypto:[cryptotag2audio] [cryptosuiteaescm128sha1322audio] inline:[cryptokeyparams2audio]
a=rtcp:[rtpstream_audio_port+1]
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<!-- UC360 INVITE/200/ACK/BYE/200 sample UAC scenario -->

<scenario name="Basic UC360 UAC">

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

INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: 16001 <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: 10 INVITE
Contact: <sip:16001@[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Max-Forwards: 70
User-Agent: VIRTUAL Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99; 08:00:0F:74:80:E1)
Subject: Conference
Session-Expires: 3600;refresher=uas
Min-SE: 90
Supported: 100rel
Require: 100rel
Content-Length: [len]

v=0
o=16001 0 0 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [rtpstream_audio_port] RTP/AVP 0 18 9 103 8 101
a=rtcp:[rtpstream_audio_port+1]
a=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio]
a=crypto:[cryptotag2audio] [cryptosuiteaescm128sha1322audio] inline:[cryptokeyparams2audio]
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=rtpmap:9 G722/16000
a=fmtp:9 bitrate=64000
a=rtpmap:103 G7221/16000
a=fmtp:103 bitrate=32000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-11,16

]]>
</send>

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

<recv response="180">
<action>
<!-- NOTE: Save the 180 Ringing's CSeq header for later reuse -->
<ereg regexp=".*" search_in="hdr" header="CSeq:" check_it="true" assign_to="1" />
<!-- NOTE: Save the 180 Ringing's RSeq header for later reuse -->
<ereg regexp=".*" search_in="hdr" header="RSeq:" check_it="true" assign_to="2" />
</action>
</recv>

<!-- Send PRACK for 180 Ringing -->
<send retrans="500">
<![CDATA[

PRACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: 16001 <sip:16001@[local_ip]:[local_port]>;tag=[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 11 PRACK
RAck: [$2][$1]
Contact: <sip:16001@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 70
Subject: Conference
Content-Length: 0

]]>
</send>

<!-- receive 200 OK / PRACK (180 Ringing) -->
<recv response="200">
</recv>

<!-- receive 200 OK / INVITE -->
<recv response="200">
</recv>

<!-- NOTE: [branch-5] is used to specify reuse of same [branch] value that was used five messages earlier (e.g. INVITE) -->
<send>
<![CDATA[

ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch-5]
From: "16001" <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 10 ACK
Content-Length: 0

]]>
</send>

<nop>
<action>
<exec rtp_stream="apattern,1,0,PCMU/8000" />
</action>
</nop>

<pause milliseconds="2000" />

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

INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: 16001 <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 12 INVITE
Contact: <sip:16001@[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Max-Forwards: 70
User-Agent: VIRTUAL Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99; 08:00:0F:74:80:E1)
Subject: Conference
Session-Expires: 3600;refresher=uas
Min-SE: 90
Supported: 100rel
Require: 100rel
Content-Length: [len]

v=0
o=16001 0 1 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [rtpstream_audio_port+2] RTP/AVP 0 18 9 103 8 101
a=rtcp:[rtpstream_audio_port+1]
a=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio]
a=crypto:[cryptotag2audio] [cryptosuiteaescm128sha1322audio] inline:[cryptokeyparams2audio]
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=rtpmap:9 G722/16000
a=fmtp:9 bitrate=64000
a=rtpmap:103 G7221/16000
a=fmtp:103 bitrate=32000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-11,16

]]>
</send>

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

<!-- receive 200 OK / INVITE -->
<recv response="200">
</recv>

<!-- NOTE: [branch-3] is used to specify reuse of same [branch] value that was used three messages earlier (e.g. INVITE) -->
<send>
<![CDATA[

ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch-3]
From: "16001" <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 12 ACK
Content-Length: 0

]]>
</send>

<nop>
<action>
<exec rtp_stream="apattern,2,0,PCMU/8000" />
</action>
</nop>

<pause milliseconds="2000" />

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

BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: "16001" <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
To: <sip:[service]@[remote_ip]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 13 BYE
Contact: <sip:16001@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 70
Subject: Conference
User-Agent: VIRTUAL Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99; 08:00:0F:74:80:E1)
Content-Length: 0

]]>
</send>

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

<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>

<!-- definition of the call length repartition table (unit is ms) -->
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>

</scenario>
Loading
Loading