diff --git a/include/rtpstream.hpp b/include/rtpstream.hpp index a25fd292..73c84a0a 100644 --- a/include/rtpstream.hpp +++ b/include/rtpstream.hpp @@ -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& 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); diff --git a/include/sipp.hpp b/include/sipp.hpp index 324f7614..3ba3f7f6 100644 --- a/include/sipp.hpp +++ b/include/sipp.hpp @@ -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" @@ -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 @@ -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); @@ -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 */ diff --git a/regress/github-#0196/run b/regress/github-#0196/run index 6955d7dd..2056f87d 100755 --- a/regress/github-#0196/run +++ b/regress/github-#0196/run @@ -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=$? diff --git a/regress/github-#0276/run b/regress/github-#0276/run index f074d471..ef3bc6e1 100755 --- a/regress/github-#0276/run +++ b/regress/github-#0276/run @@ -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=$? diff --git a/sipp_scenarios/pfca_uac_apattern_crypto_simple_renegotiation.xml b/sipp_scenarios/pfca_uac_apattern_crypto_simple_renegotiation.xml index eeb8dd9f..dd66b1f4 100644 --- a/sipp_scenarios/pfca_uac_apattern_crypto_simple_renegotiation.xml +++ b/sipp_scenarios/pfca_uac_apattern_crypto_simple_renegotiation.xml @@ -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 @@ -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 diff --git a/sipp_scenarios/pfca_uac_apattern_crypto_simple_renegotiation_rotation.xml b/sipp_scenarios/pfca_uac_apattern_crypto_simple_renegotiation_rotation.xml new file mode 100644 index 00000000..9400bced --- /dev/null +++ b/sipp_scenarios/pfca_uac_apattern_crypto_simple_renegotiation_rotation.xml @@ -0,0 +1,215 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_apattern_renegotiation.xml b/sipp_scenarios/pfca_uac_apattern_renegotiation.xml new file mode 100644 index 00000000..58717f7f --- /dev/null +++ b/sipp_scenarios/pfca_uac_apattern_renegotiation.xml @@ -0,0 +1,259 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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=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 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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] RTP/AVP 0 18 9 103 8 101 + a=rtcp:[rtpstream_audio_port+1] + 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 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_apattern_renegotiation_rotation.xml b/sipp_scenarios/pfca_uac_apattern_renegotiation_rotation.xml new file mode 100644 index 00000000..4427e58d --- /dev/null +++ b/sipp_scenarios/pfca_uac_apattern_renegotiation_rotation.xml @@ -0,0 +1,259 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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=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 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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=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 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_apattern_simple_renegotiation.xml b/sipp_scenarios/pfca_uac_apattern_simple_renegotiation.xml new file mode 100644 index 00000000..3b09c58b --- /dev/null +++ b/sipp_scenarios/pfca_uac_apattern_simple_renegotiation.xml @@ -0,0 +1,211 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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=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 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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] RTP/AVP 0 18 9 103 8 101 + a=rtcp:[rtpstream_audio_port+1] + 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 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_avpattern.xml b/sipp_scenarios/pfca_uac_avpattern.xml index 7357764f..9d676626 100644 --- a/sipp_scenarios/pfca_uac_avpattern.xml +++ b/sipp_scenarios/pfca_uac_avpattern.xml @@ -43,9 +43,9 @@ a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11,16 m=video [media_port+2] RTP/AVP 99 98 96 97 + a=rtcp:[media_port+3] b=TIAS:1536000 b=AS:1597 - a=rtcp:[media_port+3] a=maxprate:192.0 a=sendrecv a=rtpmap:99 H264/90000 diff --git a/sipp_scenarios/pfca_uac_avpattern_renegotiation.xml b/sipp_scenarios/pfca_uac_avpattern_renegotiation.xml new file mode 100644 index 00000000..cdf0b50d --- /dev/null +++ b/sipp_scenarios/pfca_uac_avpattern_renegotiation.xml @@ -0,0 +1,295 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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=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 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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] RTP/AVP 0 18 9 103 8 101 + a=rtcp:[rtpstream_audio_port+1] + 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 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_avpattern_renegotiation_rotation.xml b/sipp_scenarios/pfca_uac_avpattern_renegotiation_rotation.xml new file mode 100644 index 00000000..948dfcb5 --- /dev/null +++ b/sipp_scenarios/pfca_uac_avpattern_renegotiation_rotation.xml @@ -0,0 +1,295 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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=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 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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=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 + m=video [rtpstream_video_port+2] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_bpattern_crypto_simple_renegotiation.xml b/sipp_scenarios/pfca_uac_bpattern_crypto_simple_renegotiation.xml index e8311b02..a6c77181 100644 --- a/sipp_scenarios/pfca_uac_bpattern_crypto_simple_renegotiation.xml +++ b/sipp_scenarios/pfca_uac_bpattern_crypto_simple_renegotiation.xml @@ -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 @@ -45,12 +45,12 @@ a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11,16 m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] a=crypto:[cryptotag2video] [cryptosuiteaescm128sha1322video] inline:[cryptokeyparams2video] b=TIAS:1536000 b=AS:1597 a=maxprate:192.0 - a=rtcp:[rtpstream_video_port+1] a=sendrecv a=rtpmap:99 H264/90000 a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 @@ -154,9 +154,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 @@ -168,12 +168,12 @@ a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11,16 m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] a=crypto:[cryptotag2video] [cryptosuiteaescm128sha1322video] inline:[cryptokeyparams2video] b=TIAS:1536000 b=AS:1597 a=maxprate:192.0 - a=rtcp:[rtpstream_video_port+1] a=sendrecv a=rtpmap:99 H264/90000 a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 diff --git a/sipp_scenarios/pfca_uac_bpattern_crypto_simple_renegotiation_rotation.xml b/sipp_scenarios/pfca_uac_bpattern_crypto_simple_renegotiation_rotation.xml new file mode 100644 index 00000000..50e257a3 --- /dev/null +++ b/sipp_scenarios/pfca_uac_bpattern_crypto_simple_renegotiation_rotation.xml @@ -0,0 +1,249 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] + a=crypto:[cryptotag2video] [cryptosuiteaescm128sha1322video] inline:[cryptokeyparams2video] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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 + m=video [rtpstream_video_port+2] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] + a=crypto:[cryptotag2video] [cryptosuiteaescm128sha1322video] inline:[cryptokeyparams2video] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_bpattern_simple_renegotiation.xml b/sipp_scenarios/pfca_uac_bpattern_simple_renegotiation.xml new file mode 100644 index 00000000..717865db --- /dev/null +++ b/sipp_scenarios/pfca_uac_bpattern_simple_renegotiation.xml @@ -0,0 +1,241 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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=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 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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] RTP/AVP 0 18 9 103 8 101 + a=rtcp:[rtpstream_audio_port+1] + 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 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_vpattern.xml b/sipp_scenarios/pfca_uac_vpattern.xml index e66009de..8d255e76 100644 --- a/sipp_scenarios/pfca_uac_vpattern.xml +++ b/sipp_scenarios/pfca_uac_vpattern.xml @@ -31,9 +31,9 @@ c=IN IP[media_ip_type] [media_ip] t=0 0 m=video [media_port] RTP/AVP 99 98 96 97 + a=rtcp:[media_port+1] b=TIAS:1536000 b=AS:1597 - a=rtcp:[media_port+1] a=maxprate:192.0 a=sendrecv a=rtpmap:99 H264/90000 diff --git a/sipp_scenarios/pfca_uac_vpattern_crypto_simple_renegotiation.xml b/sipp_scenarios/pfca_uac_vpattern_crypto_simple_renegotiation.xml index 597e2044..644db0f2 100644 --- a/sipp_scenarios/pfca_uac_vpattern_crypto_simple_renegotiation.xml +++ b/sipp_scenarios/pfca_uac_vpattern_crypto_simple_renegotiation.xml @@ -31,12 +31,12 @@ c=IN IP[media_ip_type] [media_ip] t=0 0 m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] a=crypto:[cryptotag2video] [cryptosuiteaescm128sha1322video] inline:[cryptokeyparams2video] b=TIAS:1536000 b=AS:1597 a=maxprate:192.0 - a=rtcp:[rtpstream_video_port+1] a=sendrecv a=rtpmap:99 H264/90000 a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 @@ -139,12 +139,12 @@ c=IN IP[media_ip_type] [media_ip] t=0 0 m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] a=crypto:[cryptotag2video] [cryptosuiteaescm128sha1322video] inline:[cryptokeyparams2video] b=TIAS:1536000 b=AS:1597 a=maxprate:192.0 - a=rtcp:[rtpstream_video_port+1] a=sendrecv a=rtpmap:99 H264/90000 a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 diff --git a/sipp_scenarios/pfca_uac_vpattern_crypto_simple_renegotiation_rotation.xml b/sipp_scenarios/pfca_uac_vpattern_crypto_simple_renegotiation_rotation.xml new file mode 100644 index 00000000..5255834a --- /dev/null +++ b/sipp_scenarios/pfca_uac_vpattern_crypto_simple_renegotiation_rotation.xml @@ -0,0 +1,219 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] + a=crypto:[cryptotag2video] [cryptosuiteaescm128sha1322video] inline:[cryptokeyparams2video] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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=video [rtpstream_video_port+2] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] + a=crypto:[cryptotag2video] [cryptosuiteaescm128sha1322video] inline:[cryptokeyparams2video] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_vpattern_renegotiation.xml b/sipp_scenarios/pfca_uac_vpattern_renegotiation.xml new file mode 100644 index 00000000..fadec0f4 --- /dev/null +++ b/sipp_scenarios/pfca_uac_vpattern_renegotiation.xml @@ -0,0 +1,263 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_vpattern_renegotiation_rotation.xml b/sipp_scenarios/pfca_uac_vpattern_renegotiation_rotation.xml new file mode 100644 index 00000000..214da21f --- /dev/null +++ b/sipp_scenarios/pfca_uac_vpattern_renegotiation_rotation.xml @@ -0,0 +1,263 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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=video [rtpstream_video_port+2] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uac_vpattern_simple_renegotiation.xml b/sipp_scenarios/pfca_uac_vpattern_simple_renegotiation.xml new file mode 100644 index 00000000..866ff7bf --- /dev/null +++ b/sipp_scenarios/pfca_uac_vpattern_simple_renegotiation.xml @@ -0,0 +1,215 @@ + + + + + + + + + ;tag=[call_number] + To: + Call-ID: [call_id] + CSeq: 10 INVITE + Contact: + 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=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 11 PRACK + RAck: [$2][$1] + Contact: + Max-Forwards: 70 + Subject: Conference + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 10 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 INVITE + Contact: + 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=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=sendrecv + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 12 ACK + Content-Length: 0 + + ]]> + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + Call-ID: [call_id] + CSeq: 13 BYE + Contact: + 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 + + ]]> + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_audio_crypto_simple_renegotiation.xml b/sipp_scenarios/pfca_uas_audio_crypto_simple_renegotiation.xml index 27ed949d..3ac74e35 100644 --- a/sipp_scenarios/pfca_uas_audio_crypto_simple_renegotiation.xml +++ b/sipp_scenarios/pfca_uas_audio_crypto_simple_renegotiation.xml @@ -70,8 +70,8 @@ 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=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio] a=rtcp:[rtpstream_audio_port+1] + a=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio] a=sendrecv a=rtpmap:0 PCMU/8000 a=rtpmap:18 G729/8000 @@ -86,15 +86,15 @@ ]]> + + + - - - @@ -125,8 +125,8 @@ 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=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio] a=rtcp:[rtpstream_audio_port+1] + a=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio] a=sendrecv a=rtpmap:0 PCMU/8000 a=rtpmap:18 G729/8000 @@ -141,15 +141,15 @@ ]]> + + + - - - diff --git a/sipp_scenarios/pfca_uas_audio_crypto_simple_renegotiation_rotation.xml b/sipp_scenarios/pfca_uas_audio_crypto_simple_renegotiation_rotation.xml new file mode 100644 index 00000000..2919f0ea --- /dev/null +++ b/sipp_scenarios/pfca_uas_audio_crypto_simple_renegotiation_rotation.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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=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 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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=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 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_audio_renegotiation.xml b/sipp_scenarios/pfca_uas_audio_renegotiation.xml new file mode 100644 index 00000000..59ab0a74 --- /dev/null +++ b/sipp_scenarios/pfca_uas_audio_renegotiation.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 0 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 0 18 9 103 8 101 + a=rtcp:[media_port+1] + 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 + + ]]> + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 1 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 0 18 9 103 8 101 + a=rtcp:[media_port+1] + 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 + + ]]> + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_audio_renegotiation_echo.xml b/sipp_scenarios/pfca_uas_audio_renegotiation_echo.xml new file mode 100644 index 00000000..b55d158e --- /dev/null +++ b/sipp_scenarios/pfca_uas_audio_renegotiation_echo.xml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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=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 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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] RTP/AVP 0 18 9 103 8 101 + a=rtcp:[rtpstream_audio_port+1] + 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 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_audio_renegotiation_echo_rotation.xml b/sipp_scenarios/pfca_uas_audio_renegotiation_echo_rotation.xml new file mode 100644 index 00000000..09dacc05 --- /dev/null +++ b/sipp_scenarios/pfca_uas_audio_renegotiation_echo_rotation.xml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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=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 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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=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 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_audiovideo_renegotiation.xml b/sipp_scenarios/pfca_uas_audiovideo_renegotiation.xml new file mode 100644 index 00000000..ac603026 --- /dev/null +++ b/sipp_scenarios/pfca_uas_audiovideo_renegotiation.xml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 0 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 0 18 9 103 8 101 + a=rtcp:[media_port+1] + 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 + m=video [media_port+2] RTP/AVP 99 98 96 97 + b=TIAS:1536000 + b=AS:1597 + a=rtcp:[media_port+3] + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 1 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 0 18 9 103 8 101 + a=rtcp:[media_port+1] + 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 + m=video [media_port+2] RTP/AVP 99 98 96 97 + b=TIAS:1536000 + b=AS:1597 + a=rtcp:[media_port+3] + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_audiovideo_renegotiation_echo.xml b/sipp_scenarios/pfca_uas_audiovideo_renegotiation_echo.xml new file mode 100644 index 00000000..3e4c79a6 --- /dev/null +++ b/sipp_scenarios/pfca_uas_audiovideo_renegotiation_echo.xml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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=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 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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] RTP/AVP 0 18 9 103 8 101 + a=rtcp:[rtpstream_audio_port+1] + 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 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_audiovideo_renegotiation_echo_rotation.xml b/sipp_scenarios/pfca_uas_audiovideo_renegotiation_echo_rotation.xml new file mode 100644 index 00000000..92d14422 --- /dev/null +++ b/sipp_scenarios/pfca_uas_audiovideo_renegotiation_echo_rotation.xml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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=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 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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=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 + m=video [rtpstream_video_port+2] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_both_crypto_simple_renegotiation.xml b/sipp_scenarios/pfca_uas_both_crypto_simple_renegotiation.xml index fe41b6e4..a6adaec8 100644 --- a/sipp_scenarios/pfca_uas_both_crypto_simple_renegotiation.xml +++ b/sipp_scenarios/pfca_uas_both_crypto_simple_renegotiation.xml @@ -70,8 +70,8 @@ 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=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio] a=rtcp:[rtpstream_audio_port+1] + a=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio] a=sendrecv a=rtpmap:0 PCMU/8000 a=rtpmap:18 G729/8000 @@ -83,11 +83,11 @@ a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11,16 m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] b=TIAS:1536000 b=AS:1597 a=maxprate:192.0 - a=rtcp:[rtpstream_video_port+1] a=rtpmap:99 H264/90000 a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 a=rtpmap:98 H264/90000 @@ -100,6 +100,9 @@ ]]> + + + @@ -107,9 +110,6 @@ - - - @@ -140,8 +140,8 @@ 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=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio] a=rtcp:[rtpstream_audio_port+1] + a=crypto:[cryptotag1audio] [cryptosuiteaescm128sha1801audio] inline:[cryptokeyparams1audio] a=sendrecv a=rtpmap:0 PCMU/8000 a=rtpmap:18 G729/8000 @@ -153,11 +153,11 @@ a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11,16 m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] b=TIAS:1536000 b=AS:1597 a=maxprate:192.0 - a=rtcp:[rtpstream_video_port+1] a=rtpmap:99 H264/90000 a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 a=rtpmap:98 H264/90000 @@ -170,6 +170,9 @@ ]]> + + + @@ -177,9 +180,6 @@ - - - diff --git a/sipp_scenarios/pfca_uas_both_crypto_simple_renegotiation_rotation.xml b/sipp_scenarios/pfca_uas_both_crypto_simple_renegotiation_rotation.xml new file mode 100644 index 00000000..05033713 --- /dev/null +++ b/sipp_scenarios/pfca_uas_both_crypto_simple_renegotiation_rotation.xml @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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=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 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 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=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 + m=video [rtpstream_video_port+2] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_video_crypto_simple_renegotiation.xml b/sipp_scenarios/pfca_uas_video_crypto_simple_renegotiation.xml index c9f7bbb8..8d1ca6d4 100644 --- a/sipp_scenarios/pfca_uas_video_crypto_simple_renegotiation.xml +++ b/sipp_scenarios/pfca_uas_video_crypto_simple_renegotiation.xml @@ -70,11 +70,11 @@ c=IN IP[media_ip_type] [media_ip] t=0 0 m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] b=TIAS:1536000 b=AS:1597 a=maxprate:192.0 - a=rtcp:[rtpstream_video_port+1] a=rtpmap:99 H264/90000 a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 a=rtpmap:98 H264/90000 @@ -87,15 +87,15 @@ ]]> + + + - - - @@ -126,11 +126,11 @@ c=IN IP[media_ip_type] [media_ip] t=0 0 m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] b=TIAS:1536000 b=AS:1597 a=maxprate:192.0 - a=rtcp:[rtpstream_video_port+1] a=rtpmap:99 H264/90000 a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 a=rtpmap:98 H264/90000 @@ -143,15 +143,15 @@ ]]> + + + - - - diff --git a/sipp_scenarios/pfca_uas_video_crypto_simple_renegotiation_rotation.xml b/sipp_scenarios/pfca_uas_video_crypto_simple_renegotiation_rotation.xml new file mode 100644 index 00000000..2418a5a0 --- /dev/null +++ b/sipp_scenarios/pfca_uas_video_crypto_simple_renegotiation_rotation.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 0 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 1 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=video [rtpstream_video_port+2] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + a=crypto:[cryptotag1video] [cryptosuiteaescm128sha1801video] inline:[cryptokeyparams1video] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_video_renegotiation.xml b/sipp_scenarios/pfca_uas_video_renegotiation.xml new file mode 100644 index 00000000..6a92f36f --- /dev/null +++ b/sipp_scenarios/pfca_uas_video_renegotiation.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 0 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=video [media_port] RTP/AVP 99 98 96 97 + b=TIAS:1536000 + b=AS:1597 + a=rtcp:[media_port+1] + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 1 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=video [media_port] RTP/AVP 99 98 96 97 + b=TIAS:1536000 + b=AS:1597 + a=rtcp:[media_port+1] + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_video_renegotiation_echo.xml b/sipp_scenarios/pfca_uas_video_renegotiation_echo.xml new file mode 100644 index 00000000..c76b01c7 --- /dev/null +++ b/sipp_scenarios/pfca_uas_video_renegotiation_echo.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 0 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 1 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sipp_scenarios/pfca_uas_video_renegotiation_echo_rotation.xml b/sipp_scenarios/pfca_uas_video_renegotiation_echo_rotation.xml new file mode 100644 index 00000000..ac76614d --- /dev/null +++ b/sipp_scenarios/pfca_uas_video_renegotiation_echo_rotation.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + Server: VIRTUAL Mitel-3300-ICP-12.0.1.99 + Content-Length: 0 + + ]]> + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 0 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=video [rtpstream_video_port] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + Server: VIRTUAL Mitel-3300-ICP 12.0.1.99 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=16002 0 1 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=video [rtpstream_video_port+2] RTP/AVP 99 98 96 97 + a=rtcp:[rtpstream_video_port+1] + b=TIAS:1536000 + b=AS:1597 + a=maxprate:192.0 + a=rtpmap:99 H264/90000 + a=fmtp:99 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + a=rtpmap:98 H264/90000 + a=fmtp:98 profile-level-id=64000d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:96 H264/90000 + a=fmtp:96 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=0 + a=rtpmap:97 H264/90000 + a=fmtp:97 profile-level-id=42800d; max-mbps=108000; max-fs=3600; max-br=1280; packetization-mode=1 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/call.cpp b/src/call.cpp index c2e3595f..b957e145 100644 --- a/src/call.cpp +++ b/src/call.cpp @@ -2679,11 +2679,7 @@ char* call::createSendingMessage(SendingMessage *src, int P_index, char *msg_buf break; case E_Message_Auto_Media_Port: case E_Message_Media_Port: { - int port = media_port + comp->offset; - if (comp->type == E_Message_Auto_Media_Port) { - port += (4 * (number - 1)) % 10000; - } -#ifdef PCAPPLAY + int port = 0; char *begin = dest; while (begin > msg_buffer) { if (*begin == '\n') { @@ -2694,17 +2690,32 @@ char* call::createSendingMessage(SendingMessage *src, int P_index, char *msg_buf if (begin == msg_buffer) { ERROR("Can not find beginning of a line for the media port!"); } + +#ifdef PCAPPLAY play_args_t* play_args = nullptr; +#endif if (strstr(begin, "audio")) { + port = media_audio_port + comp->offset; +#ifdef PCAPPLAY play_args = &play_args_a; - } else if (strstr(begin, "image")) { - play_args = &play_args_i; +#endif } else if (strstr(begin, "video")) { + port = media_video_port + comp->offset; +#ifdef PCAPPLAY play_args = &play_args_v; - } else { - // This check will not do, as we use the media_port in other places too. - //ERROR("media_port keyword with no audio or video on the current line (%s)", begin); +#endif + } else if (strstr(begin, "image")) { + port = media_image_port + comp->offset; +#ifdef PCAPPLAY + play_args = &play_args_i; +#endif + } + + if (comp->type == E_Message_Auto_Media_Port) { + port += (4 * (number - 1)) % 10000; } + +#ifdef PCAPPLAY if (play_args != nullptr) { if (media_ip_is_ipv6) { (_RCAST(struct sockaddr_in6 *, &(play_args->from)))->sin6_port = htons(port); @@ -2713,45 +2724,100 @@ char* call::createSendingMessage(SendingMessage *src, int P_index, char *msg_buf } } #endif + dest += snprintf(dest, left, "%u", port); break; } case E_Message_RTPStream_Audio_Port: { - int temp_audio_port = 0; - // Only obtain port for RTP ([rtpstream_audio_port+0]) *BUT NOT* RTCP ([rtpstream_audio_port+1]) - if (comp->offset == 0) { - temp_audio_port = rtpstream_get_local_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]"); - } - } else if (comp->offset >= 1) { - temp_audio_port = rtpstream_callinfo.local_audioport + comp->offset; - } + int temp_audio_port = 0; + if (sendMode == MODE_CLIENT) { + // Only obtain port for RTP ([rtpstream_audio_port+0]) *BUT NOT* RTCP ([rtpstream_audio_port+1]) + if (comp->offset == 0) { + temp_audio_port = rtpstream_get_local_uac_audioport(&rtpstream_callinfo); + if (!temp_audio_port) { + /* Make this a warning instead? */ + ERROR("cannot assign a free UAC audio port to this call - using 0 for [rtpstream_audio_port]"); + } + } else { + if (comp->offset % 2 == 0) { + // Rotate AUDIO RTP (EVEN) port... + temp_audio_port = rtpstream_rotate_local_uac_audioport(&rtpstream_callinfo, rtpstream_callinfo.local_audioport + comp->offset); + } else { + // NO-OP - leave AUDIO RTCP (ODD) port untouched... + temp_audio_port = rtpstream_callinfo.local_audioport + comp->offset; + } + } + } else if (sendMode == MODE_SERVER) { + // Only obtain port for RTP ([rtpstream_audio_port+0]) *BUT NOT* RTCP ([rtpstream_audio_port+1]) + if (comp->offset == 0) { + temp_audio_port = rtpstream_get_local_uas_audioport(&rtpstream_callinfo); + if (!temp_audio_port) { + ERROR("Cannot assign a free UAS audio port to this call - using 0 for [rtpstream_audio_port]..."); + } + } else { + if (comp->offset % 2 == 0) { + // Rotate AUDIO RTP (EVEN) port... + temp_audio_port = rtpstream_rotate_local_uas_audioport(&rtpstream_callinfo, rtpstream_callinfo.local_audioport + comp->offset); + } else { + // NO-OP - leave AUDIO RTCP (ODD) port untouched... + temp_audio_port = rtpstream_callinfo.local_audioport + comp->offset; + } + } + } else { + WARNING("RTPStream_Audio_Port: INVALID operation mode..."); + temp_audio_port = 0; + } #ifdef USE_TLS - logSrtpInfo("call::createSendingMessage(): E_Message_RTPStream_Audio_Port: %d\n", temp_audio_port); + logSrtpInfo("call::createSendingMessage(): E_Message_RTPStream_Audio_Port: %d\n", temp_audio_port); #endif // USE_TLS - dest += snprintf(dest, left, "%d", temp_audio_port); + dest += snprintf(dest, left, "%d", temp_audio_port); } break; case E_Message_RTPStream_Video_Port: { - int temp_video_port = 0; - // Only obtain port for RTP ([rtpstream_video_port+0]) *BUT NOT* RTCP ([rtpstream_video_port+1]) - if (comp->offset == 0) { - temp_video_port = rtpstream_get_local_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]"); - } - } else if (comp->offset >= 1) { - temp_video_port = rtpstream_callinfo.local_videoport + comp->offset; - } + int temp_video_port = 0; + if (sendMode == MODE_CLIENT) { + // Only obtain port for RTP ([rtpstream_video_port+0]) *BUT NOT* RTCP ([rtpstream_video_port+1]) + if (comp->offset == 0) { + temp_video_port = rtpstream_get_local_uac_videoport(&rtpstream_callinfo); + if (!temp_video_port) { + /* Make this a warning instead? */ + ERROR("cannot assign a free UAC video port to this call - using 0 for [rtpstream_video_port]"); + } + } else { + if (comp->offset % 2 == 0) { + // Rotate VIDEO RTP (EVEN) port... + temp_video_port = rtpstream_rotate_local_uac_videoport(&rtpstream_callinfo, rtpstream_callinfo.local_videoport + comp->offset); + } else { + // NO-OP - leave VIDEO RTCP (ODD) port untouched... + temp_video_port = rtpstream_callinfo.local_videoport + comp->offset; + } + } + } else if (sendMode == MODE_SERVER) { + // Only obtain port for RTP ([rtpstream_video_port+0]) *BUT NOT* RTCP ([rtpstream_video_port+1]) + if (comp->offset == 0) { + temp_video_port = rtpstream_get_local_uas_videoport(&rtpstream_callinfo); + if (!temp_video_port) { + ERROR("Cannot assign a free UAS video port to this call - using 0 for [rtpstream_video_port]..."); + } + } else { + if (comp->offset % 2 == 0) { + // Rotate VIDEO RTP (EVEN) port... + temp_video_port = rtpstream_rotate_local_uas_videoport(&rtpstream_callinfo, rtpstream_callinfo.local_videoport + comp->offset); + } else { + // NO-OP leave VIDEO RTCP (ODD) port untouched... + temp_video_port = rtpstream_callinfo.local_videoport + comp->offset; + } + } + } else { + WARNING("RTPStream_Video_Port: INVALID operation mode..."); + temp_video_port = 0; + } #ifdef USE_TLS - logSrtpInfo("call::createSendingMessage(): E_Message_RTPStream_Video_Port: %d\n", temp_video_port); + logSrtpInfo("call::createSendingMessage(): E_Message_RTPStream_Video_Port: %d\n", temp_video_port); #endif // USE_TLS - dest += snprintf(dest, left, "%d", temp_video_port); + dest += snprintf(dest, left, "%d", temp_video_port); } break; #ifdef USE_TLS diff --git a/src/rtpstream.cpp b/src/rtpstream.cpp index d9539f86..4b8badc5 100644 --- a/src/rtpstream.cpp +++ b/src/rtpstream.cpp @@ -119,7 +119,8 @@ struct cached_pattern_t cached_file_t *cached_files = nullptr; cached_pattern_t *cached_patterns = nullptr; int num_cached_files = 0; -int next_rtp_port = 0; +int next_rtp_audio_port = 0; +int next_rtp_video_port = 0; threaddata_t **ready_threads = nullptr; threaddata_t **busy_threads = nullptr; @@ -153,11 +154,15 @@ pthread_t pthread_videoecho_id; #ifdef USE_TLS static bool quit_audioecho_thread = false; static bool quit_videoecho_thread = false; +static bool portrotation_uas_audioecho_thread = false; +static bool portrotation_uas_videoecho_thread = false; #endif pthread_mutex_t quit_mutexaudio = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t quit_mutexvideo = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t quit_cvaudio = PTHREAD_COND_INITIALIZER; pthread_cond_t quit_cvvideo = PTHREAD_COND_INITIALIZER; +pthread_mutex_t portrotation_uas_mutexaudio = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t portrotation_uas_mutexvideo = PTHREAD_MUTEX_INITIALIZER; // JLSRTP contexts SrtpChannel g_txUACAudio; @@ -447,7 +452,7 @@ static void rtpstream_free_taskinfo(taskentry_t* taskinfo) { if (taskinfo) { #ifdef USE_TLS - /* audio SRTP echo activity indicators */ + /* audio/video SRTP echo activity indicators */ taskinfo->audio_srtp_echo_active = 0; taskinfo->video_srtp_echo_active = 0; #endif // USE_TLS @@ -1824,17 +1829,35 @@ static int rtpstream_setsocketoptions(int sock) } /* code checked */ -static int rtpstream_get_localport(int* rtpsocket, int* rtcpsocket) +static int rtpstream_get_uac_localport(int* rtpsocket, int* rtcpsocket, const char* mediaType) { int port_number = 0; int tries; struct sockaddr_storage address; - int max_tries = (min_rtp_port < (max_rtp_port - 2)) ? (max_rtp_port - min_rtp_port) : 1; + int max_tries = 0; - debugprint("rtpstream_get_localport\n"); + if (!strcmp(mediaType, "audio")) { + max_tries = (min_rtp_audio_port < (max_rtp_audio_port - 2)) ? (max_rtp_audio_port - min_rtp_audio_port) : 1; + } else if (!strcmp(mediaType, "video")) { + max_tries = (min_rtp_video_port < (max_rtp_video_port - 2)) ? (max_rtp_video_port - min_rtp_video_port) : 1; + } else { + WARNING("rtpstream_get_uac_localport(): INVALID mediaType specified encountered while determining max_tries: [%s]", mediaType); + return 0; + } + + debugprint("rtpstream_get_uac_localport\n"); - if (next_rtp_port == 0) { - next_rtp_port = min_rtp_port; + if (!strcmp(mediaType, "audio")) { + if (next_rtp_audio_port == 0) { + next_rtp_audio_port = min_rtp_audio_port; + } + } else if (!strcmp(mediaType, "video")) { + if (next_rtp_video_port == 0) { + next_rtp_video_port = min_rtp_video_port; + } + } else { + WARNING("rtpstream_get_uac_localport(): INVALID mediaType specified when performing RTP port initialization: [%s]", mediaType); + return 0; } /* initialise address family and IP address for media socket */ @@ -1843,27 +1866,45 @@ static int rtpstream_get_localport(int* rtpsocket, int* rtcpsocket) if ((media_ip_is_ipv6? inet_pton(AF_INET6, media_ip, &((_RCAST(struct sockaddr_in6 *, &address))->sin6_addr)): inet_pton(AF_INET, media_ip, &((_RCAST(struct sockaddr_in *, &address))->sin_addr))) != 1) { - WARNING("Could not set up media IP for RTP streaming"); + WARNING("Could not set up UAC media IP for RTP streaming"); return 0; } /* create new UDP listen socket */ *rtpsocket = socket(media_ip_is_ipv6?PF_INET6:PF_INET, SOCK_DGRAM, 0); if (*rtpsocket == -1) { - WARNING("Could not open socket for RTP streaming: %s", strerror(errno)); + WARNING("Could not open UAC socket for RTP streaming: %s", strerror(errno)); return 0; } for (tries = 0; tries < max_tries; tries++) { - /* try a sequence of port numbers until we find one where we can bind */ - /* should normally be the first port we try, unless we have long-running */ - /* calls or somebody else is nicking ports. */ - port_number = next_rtp_port; + if (!strcmp(mediaType, "audio")) { + /* try a sequence of port numbers until we find one where we can bind */ + /* should normally be the first port we try, unless we have long-running */ + /* calls or somebody else is nicking ports. */ + port_number = next_rtp_audio_port; - /* skip rtp ports in multiples of 2 (allow for rtp plus rtcp) */ - next_rtp_port += 2; - if (next_rtp_port > (max_rtp_port - 1)) { - next_rtp_port = min_rtp_port; + /* skip rtp ports in multiples of 2 (allow for rtp plus rtcp) */ + next_rtp_audio_port += 2; + + if (next_rtp_audio_port > (max_rtp_audio_port - 1)) { + next_rtp_audio_port = min_rtp_audio_port; + } + } else if (!strcmp(mediaType, "video")) { + /* try a sequence of port numbers until we find one where we can bind */ + /* should normally be the first port we try, unless we have long-running */ + /* calls or somebody else is nicking ports. */ + port_number = next_rtp_video_port; + + /* skip rtp ports in multiples of 2 (allow for rtp plus rtcp) */ + next_rtp_video_port += 2; + + if (next_rtp_video_port > (max_rtp_video_port - 1)) { + next_rtp_video_port = min_rtp_video_port; + } + } else { + WARNING("rtpstream_get_uac_localport(): INVALID mediatype specified when checking upper RTP port boundary: [%s]", mediaType); + return 0; } sockaddr_update_port(&address, port_number); @@ -1877,14 +1918,14 @@ static int rtpstream_get_localport(int* rtpsocket, int* rtcpsocket) if (tries == max_tries) { close(*rtpsocket); *rtpsocket = -1; - WARNING("Could not bind port for RTP streaming after %d tries", tries); + WARNING("Could not bind UAC port for RTP streaming after %d tries", tries); return 0; } if (!rtpstream_setsocketoptions(*rtpsocket)) { close(*rtpsocket); *rtpsocket = -1; - WARNING("Could not set socket options for RTP streaming"); + WARNING("Could not set UAC socket options for RTP streaming"); return 0; } @@ -1894,8 +1935,7 @@ static int rtpstream_get_localport(int* rtpsocket, int* rtcpsocket) if (*rtcpsocket != -1 && port_number > 0) { /* try to bind it to our preferred address */ sockaddr_update_port(&address, port_number + 1); - if (::bind(*rtcpsocket, (sockaddr *) (void *)&address, - socklen_from_addr(&address)) == 0) { + if (::bind(*rtcpsocket, (sockaddr *) (void *)&address, socklen_from_addr(&address)) != 0) { /* could not bind the rtcp socket to required port. so we delete it */ close(*rtcpsocket); *rtcpsocket = -1; @@ -1909,10 +1949,309 @@ static int rtpstream_get_localport(int* rtpsocket, int* rtcpsocket) return port_number; } +static int rtpstream_rotate_uac_localport(int* oldRtpSocket, int* oldRtcpSocket, int* newRtpSocket, int* newRtcpSocket, int newPort, const char* mediaType) +{ + struct sockaddr_storage address; + + debugprint("rtpstream_rotate_uac_localport\n"); + + if (*newRtpSocket != *oldRtpSocket) { + if (!strcmp(mediaType, "audio")) { + if (next_rtp_audio_port == 0) { + next_rtp_audio_port = min_rtp_audio_port; + } + } else if (!strcmp(mediaType, "video")) { + if (next_rtp_video_port == 0) { + next_rtp_video_port = min_rtp_video_port; + } + } else { + WARNING("rtpstream_rotate_uac_localport(): INVALID mediaType specified when performing RTP port initialization: [%s]", mediaType); + return 0; + } + + if (!strcmp(mediaType, "audio")) { + next_rtp_audio_port = newPort + 2; + if (next_rtp_audio_port > (max_rtp_audio_port - 1)) { + next_rtp_audio_port = min_rtp_audio_port; + } + } else if (!strcmp(mediaType, "video")) { + next_rtp_video_port = newPort + 2; + if (next_rtp_video_port > (max_rtp_video_port - 1)) { + next_rtp_video_port = min_rtp_video_port; + } + } else { + WARNING("rtpstream_rotate_uac_localport(): INVALID mediaType specified when checking upper RTP port boundary: [%s]", mediaType); + return 0; + } + + /* initialise address family and IP address for media socket */ + memset(&address, 0, sizeof(address)); + address.ss_family = media_ip_is_ipv6 ? AF_INET6 : AF_INET; + if ((media_ip_is_ipv6? + inet_pton(AF_INET6, media_ip, &((_RCAST(struct sockaddr_in6 *, &address))->sin6_addr)): + inet_pton(AF_INET, media_ip, &((_RCAST(struct sockaddr_in *, &address))->sin_addr))) != 1) { + WARNING("Could not set up UAC media IP for RTP streaming"); + return 0; + } + + /* create new UDP listen socket */ + *newRtpSocket = socket(media_ip_is_ipv6?PF_INET6:PF_INET, SOCK_DGRAM, 0); + if (*newRtpSocket == -1) { + WARNING("Could not open NEW UAC socket for RTP streaming: %s", strerror(errno)); + return 0; + } + + sockaddr_update_port(&address, newPort); + if (::bind(*newRtpSocket, (sockaddr*)&address, socklen_from_addr(&address)) != 0) { + /* Exit here if we didn't get a suitable port for rtp stream */ + close(*newRtpSocket); + *newRtpSocket = -1; + WARNING("Could not bind NEW UAC port [%d] for RTP streaming", newPort); + return 0; + } + + if (!rtpstream_setsocketoptions(*newRtpSocket)) { + close(*newRtpSocket); + *newRtpSocket = -1; + WARNING("Could not set NEW UAC socket options for RTP streaming"); + return 0; + } + + if (*oldRtpSocket != -1) { + close(*oldRtpSocket); + *oldRtpSocket = -1; + } + } + + if (*newRtcpSocket != *oldRtcpSocket) { + /* create socket for rtcp - ignore any errors, we only bind so we + * won't send icmp-port-unreachable when rtcp arrives */ + *newRtcpSocket = socket(media_ip_is_ipv6?PF_INET6:PF_INET, SOCK_DGRAM, 0); + if (*newRtcpSocket != -1 && newPort > 0) { + /* try to bind it to our preferred address */ + sockaddr_update_port(&address, newPort + 1); + if (::bind(*newRtcpSocket, (sockaddr *) (void *)&address, socklen_from_addr(&address)) != 0) { + /* could not bind the rtcp socket to required port. so we delete it */ + close(*newRtcpSocket); + *newRtcpSocket = -1; + } + if (!rtpstream_setsocketoptions(*newRtcpSocket)) { + close(*newRtcpSocket); + *newRtcpSocket = -1; + } + } + + if (*oldRtcpSocket != -1) { + close(*oldRtcpSocket); + *oldRtcpSocket = -1; + } + } + + return newPort; +} + /* code checked */ -int rtpstream_get_local_audioport(rtpstream_callinfo_t* callinfo) +static int rtpstream_get_uas_localport(int* rtpsocket, int* rtcpsocket, const char* mediaType) { - debugprint("rtpstream_get_local_audioport callinfo=%p", callinfo); + int uas_port_number = 0; + struct sockaddr_storage address; + + debugprint("rtpstream_get_uas_localport\n"); + + if (!strcmp(mediaType, "audio")) { + if (next_rtp_audio_port == 0) { + next_rtp_audio_port = min_rtp_audio_port; + } + } else if (!strcmp(mediaType, "video")) { + if (next_rtp_video_port == 0) { + next_rtp_video_port = min_rtp_video_port; + } + } else { + WARNING("rtpstream_get_uas_localport(): INVALID mediaType specified when performing RTP port initialization: [%s]", mediaType); + return 0; + } + + /* initialise address family and IP address for media socket */ + memset(&address, 0, sizeof(address)); + address.ss_family = media_ip_is_ipv6 ? AF_INET6 : AF_INET; + if ((media_ip_is_ipv6? + inet_pton(AF_INET6, media_ip, &((_RCAST(struct sockaddr_in6 *, &address))->sin6_addr)): + inet_pton(AF_INET, media_ip, &((_RCAST(struct sockaddr_in *, &address))->sin_addr))) != 1) { + WARNING("Could not set up UAS media IP for RTP streaming"); + return 0; + } + + /* create new UDP listen socket */ + *rtpsocket = socket(media_ip_is_ipv6?PF_INET6:PF_INET, SOCK_DGRAM, 0); + if (*rtpsocket == -1) { + WARNING("Could not open UAS socket for RTP streaming: %s", strerror(errno)); + return 0; + } + + if (!strcmp(mediaType, "audio")) { + uas_port_number = next_rtp_audio_port; + + /* skip rtp ports in multiples of 2 (allow for rtp plus rtcp) */ + next_rtp_audio_port += 2; + + if (next_rtp_audio_port > (max_rtp_audio_port - 1 )) { + next_rtp_audio_port = min_rtp_audio_port; + } + } else if (!strcmp(mediaType, "video")) { + uas_port_number = next_rtp_video_port; + + /* skip rtp ports in multiples of 2 (allow for rtp plus rtcp) */ + next_rtp_video_port += 2; + + if (next_rtp_video_port > (max_rtp_video_port - 1)) { + next_rtp_video_port = min_rtp_video_port; + } + } else { + WARNING("rtpstream_get_uas_localport(): INVALID mediaType specified when checking upport RTP port boundary: [%s]", mediaType); + return 0; + } + + sockaddr_update_port(&address, uas_port_number); + if (::bind(*rtpsocket, (sockaddr*)&address, socklen_from_addr(&address)) != 0) { + close(*rtpsocket); + *rtpsocket = -1; + WARNING("Could not bind UAS port for RTP streaming"); + return 0; + } + + if (!rtpstream_setsocketoptions(*rtpsocket)) { + close(*rtpsocket); + *rtpsocket = -1; + WARNING("Could not set UAS socket options for RTP streaming"); + return 0; + } + + /* create socket for rtcp - ignore any errors, we only bind so we won't send icmp-port-unreachable when rtcp arrives */ + *rtcpsocket = socket(media_ip_is_ipv6?PF_INET6:PF_INET, SOCK_DGRAM, 0); + if (*rtcpsocket != -1 && uas_port_number > 0) { + /* try to bind it to our preferred address */ + sockaddr_update_port(&address, uas_port_number + 1); + if (::bind(*rtcpsocket, (sockaddr *) (void *)&address, socklen_from_addr(&address)) != 0) { + /* could not bind the rtcp socket to required port. so we delete it */ + close(*rtcpsocket); + *rtcpsocket = -1; + } + if (!rtpstream_setsocketoptions(*rtcpsocket)) { + close(*rtcpsocket); + *rtcpsocket = -1; + } + } + + return uas_port_number; +} + +#ifdef USE_TLS +static int rtpstream_rotate_uas_localport(int* oldRtpSocket, int* oldRtcpSocket, int* newRtpSocket, int* newRtcpSocket, int newPort, const char* mediaType) +{ + struct sockaddr_storage address; + + debugprint("rtpstream_rotate_uas_localport\n"); + + if (*newRtpSocket != *oldRtpSocket) { + if (!strcmp(mediaType, "audio")) { + if (next_rtp_audio_port == 0) { + next_rtp_audio_port = min_rtp_audio_port; + } + } else if (!strcmp(mediaType, "video")) { + if (next_rtp_video_port == 0) { + next_rtp_video_port = min_rtp_video_port; + } + } else { + WARNING("rtpstream_rotate_uas_localport(): INVALID mediaType specified when performing RTP port initialization: [%s]", mediaType); + return 0; + } + + if (!strcmp(mediaType, "audio")) { + next_rtp_audio_port = newPort + 2; + if (next_rtp_audio_port > (max_rtp_audio_port - 1)) { + next_rtp_audio_port = min_rtp_audio_port; + } + } else if (!strcmp(mediaType, "video")) { + next_rtp_video_port = newPort + 2; + if (next_rtp_video_port > (max_rtp_video_port - 1)) { + next_rtp_video_port = min_rtp_video_port; + } + } else { + WARNING("rtpstream_rotate_uas_localport(): INVALID mediaType specified when checking upper RTP port boundary: [%s]", mediaType); + return 0; + } + + /* initialise address family and IP address for media socket */ + memset(&address, 0, sizeof(address)); + address.ss_family = media_ip_is_ipv6 ? AF_INET6 : AF_INET; + if ((media_ip_is_ipv6? + inet_pton(AF_INET6, media_ip, &((_RCAST(struct sockaddr_in6 *, &address))->sin6_addr)): + inet_pton(AF_INET, media_ip, &((_RCAST(struct sockaddr_in *, &address))->sin_addr))) != 1) { + WARNING("Could not set up UAS media IP for RTP streaming"); + return 0; + } + + /* create new UDP listen socket */ + *newRtpSocket = socket(media_ip_is_ipv6?PF_INET6:PF_INET, SOCK_DGRAM, 0); + if (*newRtpSocket == -1) { + WARNING("Could not open NEW UAS socket for RTP streaming: %s", strerror(errno)); + return 0; + } + + sockaddr_update_port(&address, newPort); + if (::bind(*newRtpSocket, (sockaddr*)&address, socklen_from_addr(&address)) != 0) { + /* Exit here if we didn't get a suitable port for rtp stream */ + close(*newRtpSocket); + *newRtpSocket = -1; + WARNING("Could not bind NEW UAS port [%d] for RTP streaming", newPort); + return 0; + } + + if (!rtpstream_setsocketoptions(*newRtpSocket)) { + close(*newRtpSocket); + *newRtpSocket = -1; + WARNING("Could not set NEW UAS socket options for RTP streaming"); + return 0; + } + + if (*oldRtpSocket != -1) { + close(*oldRtpSocket); + *oldRtpSocket = -1; + } + } + + if (*newRtcpSocket != *oldRtcpSocket) { + /* create socket for rtcp - ignore any errors, we only bind so we + * won't send icmp-port-unreachable when rtcp arrives */ + *newRtcpSocket = socket(media_ip_is_ipv6?PF_INET6:PF_INET, SOCK_DGRAM, 0); + if (*newRtcpSocket != -1 && newPort > 0) { + /* try to bind it to our preferred address */ + sockaddr_update_port(&address, newPort + 1); + if (::bind(*newRtcpSocket, (sockaddr *) (void *)&address, socklen_from_addr(&address)) != 0) { + /* could not bind the rtcp socket to required port. so we delete it */ + close(*newRtcpSocket); + *newRtcpSocket = -1; + } + if (!rtpstream_setsocketoptions(*newRtcpSocket)) { + close(*newRtcpSocket); + *newRtcpSocket = -1; + } + } + + if (*oldRtcpSocket != -1) { + close(*oldRtcpSocket); + *oldRtcpSocket = -1; + } + } + + return newPort; +} +#endif // USE_TLS + +/* code checked */ +int rtpstream_get_local_uac_audioport(rtpstream_callinfo_t* callinfo) +{ + debugprint("rtpstream_get_local_uac_audioport callinfo=%p", callinfo); int rtp_socket; int rtcp_socket; @@ -1927,7 +2266,7 @@ int rtpstream_get_local_audioport(rtpstream_callinfo_t* callinfo) return callinfo->local_audioport; } - callinfo->local_audioport = rtpstream_get_localport(&rtp_socket, &rtcp_socket); + callinfo->local_audioport = rtpstream_get_uac_localport(&rtp_socket, &rtcp_socket, "audio"); debugprint(" ==> %d\n", callinfo->local_audioport); @@ -1950,9 +2289,9 @@ int rtpstream_get_local_audioport(rtpstream_callinfo_t* callinfo) } /* code checked */ -int rtpstream_get_local_videoport(rtpstream_callinfo_t* callinfo) +int rtpstream_get_local_uac_videoport(rtpstream_callinfo_t* callinfo) { - debugprint("rtpstream_get_local_videoport callinfo=%p", callinfo); + debugprint("rtpstream_get_local_uac_videoport callinfo=%p", callinfo); int rtp_socket; int rtcp_socket; @@ -1967,7 +2306,73 @@ int rtpstream_get_local_videoport(rtpstream_callinfo_t* callinfo) return callinfo->local_videoport; } - callinfo->local_videoport = rtpstream_get_localport(&rtp_socket, &rtcp_socket); + callinfo->local_videoport = rtpstream_get_uac_localport(&rtp_socket, &rtcp_socket, "video"); + + debugprint(" ==> %d\n", callinfo->local_videoport); + + /* assign rtp and rtcp sockets to callinfo. must assign rtcp socket first */ + callinfo->taskinfo->video_rtcp_socket = rtcp_socket; + callinfo->taskinfo->video_rtp_socket = rtp_socket; + + /* start playback task if not already started */ + if (!callinfo->taskinfo->parent_thread) { + if (!rtpstream_start_task(callinfo)) { + /* error starting playback task */ + return 0; + } + } + + /* make sure the new socket gets bound to destination address (if any) */ + callinfo->taskinfo->flags |= TI_RECONNECTSOCKET; + + return callinfo->local_videoport; +} + +int rtpstream_rotate_local_uac_audioport(rtpstream_callinfo_t* callinfo, int newPort) +{ + debugprint("rtpstream_rotate_local_uac_audioport callinfo=%p", callinfo); + + int rtp_socket = 0; + int rtcp_socket = 0; + + if (!callinfo->taskinfo) { + return 0; + } + + callinfo->local_audioport = rtpstream_rotate_uac_localport(&callinfo->taskinfo->audio_rtp_socket, &callinfo->taskinfo->audio_rtcp_socket, &rtp_socket, &rtcp_socket, newPort, "audio"); + + debugprint(" ==> %d\n", callinfo->local_audioport); + + /* assign rtp and rtcp sockets to callinfo. must assign rtcp socket first */ + callinfo->taskinfo->audio_rtcp_socket = rtcp_socket; + callinfo->taskinfo->audio_rtp_socket = rtp_socket; + + /* start playback task if not already started */ + if (!callinfo->taskinfo->parent_thread) { + if (!rtpstream_start_task(callinfo)) { + /* error starting playback task */ + return 0; + } + } + + /* make sure the new socket gets bound to destination address (if any) */ + callinfo->taskinfo->flags |= TI_RECONNECTSOCKET; + + return callinfo->local_audioport; +} + +int rtpstream_rotate_local_uac_videoport(rtpstream_callinfo_t* callinfo, int newPort) +{ + debugprint("rtpstream_rotate_local_uac_videoport callinfo=%p", callinfo); + + int rtp_socket = 0; + int rtcp_socket = 0; + + if (!callinfo->taskinfo) { + return 0; + } + + callinfo->local_videoport = rtpstream_rotate_uac_localport(&callinfo->taskinfo->video_rtp_socket, &callinfo->taskinfo->video_rtcp_socket, &rtp_socket, &rtcp_socket, newPort, "video"); debugprint(" ==> %d\n", callinfo->local_videoport); @@ -1989,6 +2394,118 @@ int rtpstream_get_local_videoport(rtpstream_callinfo_t* callinfo) return callinfo->local_videoport; } +int rtpstream_get_local_uas_audioport(rtpstream_callinfo_t* callinfo) +{ + debugprint("rtpstream_get_local_uas_audioport callinfo=%p", callinfo); + + int rtp_socket; + int rtcp_socket; + + if (!callinfo->taskinfo) { + return 0; + } + + if (callinfo->local_audioport) { + /* already a port assigned to this call */ + debugprint(" ==> %d\n", callinfo->local_audioport); + return callinfo->local_audioport; + } + + callinfo->local_audioport = rtpstream_get_uas_localport(&rtp_socket, &rtcp_socket, "audio"); + + debugprint(" ==> %d\n", callinfo->local_audioport); + + /* assign rtp and rtcp sockets to callinfo. must assign rtcp socket first */ + callinfo->taskinfo->audio_rtcp_socket = rtcp_socket; + callinfo->taskinfo->audio_rtp_socket = rtp_socket; + + return callinfo->local_audioport; +} + +int rtpstream_get_local_uas_videoport(rtpstream_callinfo_t* callinfo) +{ + debugprint("rtpstream_get_local_uas_videoport callinfo=%p", callinfo); + + int rtp_socket; + int rtcp_socket; + + if (!callinfo->taskinfo) { + return 0; + } + + if (callinfo->local_videoport) { + /* already a port assigned to this call */ + debugprint(" ==> %d\n", callinfo->local_videoport); + return callinfo->local_videoport; + } + + callinfo->local_videoport = rtpstream_get_uas_localport(&rtp_socket, &rtcp_socket, "video"); + + debugprint(" ==> %d\n", callinfo->local_videoport); + + /* assign rtp and rtcp sockets to callinfo. must assign rtcp socket first */ + callinfo->taskinfo->video_rtcp_socket = rtcp_socket; + callinfo->taskinfo->video_rtp_socket = rtp_socket; + + return callinfo->local_videoport; +} + +int rtpstream_rotate_local_uas_audioport(rtpstream_callinfo_t* callinfo, int newPort) +{ + debugprint("rtpstream_rotate_local_uas_audioport callinfo=%p", callinfo); + + if (!callinfo->taskinfo) { + return 0; + } + +#ifdef USE_TLS + int rtp_socket = 0; + int rtcp_socket = 0; + + pthread_mutex_lock(&portrotation_uas_mutexaudio); + portrotation_uas_audioecho_thread = true; + pthread_mutex_unlock(&portrotation_uas_mutexaudio); + + callinfo->local_audioport = rtpstream_rotate_uas_localport(&callinfo->taskinfo->audio_rtp_socket, &callinfo->taskinfo->audio_rtcp_socket, &rtp_socket, &rtcp_socket, newPort, "audio"); + + debugprint(" ==> %d\n", callinfo->local_audioport); + + /* assign rtp and rtcp sockets to callinfo. must assign rtcp socket first */ + callinfo->taskinfo->audio_rtcp_socket = rtcp_socket; + callinfo->taskinfo->audio_rtp_socket = rtp_socket; +#endif // USE_TLS + + return callinfo->local_audioport; +} + +int rtpstream_rotate_local_uas_videoport(rtpstream_callinfo_t* callinfo, int newPort) +{ + debugprint("rtpstream_rotate_local_uas_videoport callinfo=%p", callinfo); + + if (!callinfo->taskinfo) { + return 0; + } + +#ifdef USE_TLS + int rtp_socket = 0; + int rtcp_socket = 0; + + pthread_mutex_lock(&portrotation_uas_mutexvideo); + portrotation_uas_videoecho_thread = true; + pthread_mutex_unlock(&portrotation_uas_mutexvideo); + + callinfo->local_videoport = rtpstream_rotate_uas_localport(&callinfo->taskinfo->video_rtp_socket, &callinfo->taskinfo->video_rtcp_socket, &rtp_socket, &rtcp_socket, newPort, "video"); + + debugprint(" ==> %d\n", callinfo->local_videoport); + + /* assign rtp and rtcp sockets to callinfo. must assign rtcp socket first */ + callinfo->taskinfo->video_rtcp_socket = rtcp_socket; + callinfo->taskinfo->video_rtp_socket = rtp_socket; +#endif // USE_TLS + + return callinfo->local_videoport; +} + /* code checked */ void rtpstream_set_remote(rtpstream_callinfo_t* callinfo, int ip_ver, const char* ip_addr, int audio_port, int video_port) @@ -2426,7 +2943,7 @@ void rtpstream_play(rtpstream_callinfo_t* callinfo, rtpstream_actinfo_t* actioni } /* make sure we have an open socket from which to play the audio file */ - rtpstream_get_local_audioport(callinfo); + rtpstream_get_local_uac_audioport(callinfo); /* save file parameter in taskinfo structure */ taskinfo->new_audio_pattern_id = actioninfo->pattern_id; @@ -2501,7 +3018,7 @@ void rtpstream_playapattern(rtpstream_callinfo_t* callinfo, rtpstream_actinfo_t* } /* make sure we have an open socket from which to play the audio file */ - rtpstream_get_local_audioport(callinfo); + rtpstream_get_local_uac_audioport(callinfo); /* save file parameter in taskinfo structure */ taskinfo->new_audio_pattern_id = actioninfo->pattern_id; @@ -2577,7 +3094,7 @@ void rtpstream_playvpattern(rtpstream_callinfo_t* callinfo, rtpstream_actinfo_t* } /* make sure we have an open socket from which to play the video file */ - rtpstream_get_local_videoport(callinfo); + rtpstream_get_local_uac_videoport(callinfo); /* save file parameter in taskinfo structure */ taskinfo->new_video_pattern_id = actioninfo->pattern_id; @@ -2627,6 +3144,8 @@ void rtpstream_audioecho_thread(void* param) { int exit_code = 0; #ifdef USE_TLS + bool rx_auth_tag_present = false; + bool tx_auth_tag_present = false; my_unique_ptr msg { reinterpret_cast(malloc(media_bufsize)) }; ssize_t nr; @@ -2647,6 +3166,9 @@ void rtpstream_audioecho_thread(void* param) unsigned short host_seqnum = 0; unsigned int host_timestamp = 0; unsigned int host_ssrc = 0; + std::vector::iterator it = audio_packet_in.begin(); + std::vector::iterator it_payload_begin = audio_packet_in.begin(); + std::vector::iterator it_payload_end = audio_packet_in.end(); bool abnormal_termination = false; quit_audioecho_thread = false; ParamPass p; @@ -2661,6 +3183,24 @@ void rtpstream_audioecho_thread(void* param) sock = p.i; } + if (g_rxUASAudio.getCryptoTag() != 0) + { + rx_auth_tag_present = true; + } + else + { + rx_auth_tag_present = false; + } + + if (g_txUASAudio.getCryptoTag() != 0) + { + tx_auth_tag_present = true; + } + else + { + tx_auth_tag_present = false; + } + if ((flags = fcntl(sock, F_GETFL, 0)) < 0) { pthread_mutex_lock(&debugremutexaudio); @@ -2707,7 +3247,14 @@ void rtpstream_audioecho_thread(void* param) nr = 0; memset(msg.get(), 0, media_bufsize); len = sizeof(remote_rtp_addr); - audio_packet_in.resize(sizeof(rtp_header_t) + g_rxUASAudio.getSrtpPayloadSize() + g_rxUASAudio.getAuthenticationTagSize(), 0); + if (rx_auth_tag_present) + { + audio_packet_in.resize(sizeof(rtp_header_t) + g_rxUASAudio.getSrtpPayloadSize() + g_rxUASAudio.getAuthenticationTagSize(), 0); + } + else + { + audio_packet_in.resize(sizeof(rtp_header_t) + g_rxUASAudio.getSrtpPayloadSize(), 0); + } nr = recvfrom(sock, audio_packet_in.data(), audio_packet_in.size(), MSG_DONTWAIT /* NON-BLOCKING */, (sockaddr *) (void *) &remote_rtp_addr, &len); if (nr >= 0) { @@ -2733,7 +3280,7 @@ void rtpstream_audioecho_thread(void* param) } pthread_mutex_unlock(&debugremutexaudio); - if (g_rxUASAudio.getCryptoTag() != 0) + if (rx_auth_tag_present) { rtp_header.clear(); payload_data.clear(); @@ -2769,8 +3316,26 @@ void rtpstream_audioecho_thread(void* param) memcpy(msg.get(), rtp_header.data(), rtp_header.size()); memcpy(msg.get() + sizeof(rtp_header_t), payload_data.data(), payload_data.size()); } + else + { + it = audio_packet_in.begin(); + it_payload_begin = audio_packet_in.begin(); + it_payload_end = audio_packet_in.end(); + unsigned int header_payload_size = 0; - if (g_txUASAudio.getCryptoTag() != 0) + header_payload_size = sizeof(rtp_header_t) + g_rxUASAudio.getSrtpPayloadSize(); + rtp_header.clear(); + payload_data.clear(); + + std::advance(it, sizeof(rtp_header_t)); + rtp_header.assign(audio_packet_in.begin(), it); // Fetch leading 12 bytes + + std::advance(it_payload_begin, sizeof(rtp_header_t)); + std::advance(it_payload_end, header_payload_size); + payload_data.assign(it_payload_begin, it_payload_end); // Fetch payload bytes + } + + if (tx_auth_tag_present) { audio_packet_out.clear(); @@ -2790,9 +3355,18 @@ void rtpstream_audioecho_thread(void* param) fprintf(debugrefileaudio, "TXUASAUDIO -- processOutgoingPacket() rc == %d\n", rc); } pthread_mutex_unlock(&debugremutexaudio); + ns = sendto(sock, audio_packet_out.data(), sizeof(rtp_header_t) + g_txUASAudio.getSrtpPayloadSize() + g_txUASAudio.getAuthenticationTagSize(), MSG_DONTWAIT, (sockaddr *) (void *) &remote_rtp_addr, len); } + else + { + audio_packet_out.clear(); - ns = sendto(sock, audio_packet_out.data(), sizeof(rtp_header_t) + g_txUASAudio.getSrtpPayloadSize() + g_txUASAudio.getAuthenticationTagSize(), MSG_DONTWAIT, (sockaddr *) (void *) &remote_rtp_addr, len); + // ASSEMBLE PACKET + audio_packet_out.insert(audio_packet_out.end(), rtp_header.begin(), rtp_header.end()); + audio_packet_out.insert(audio_packet_out.end(), payload_data.begin(), payload_data.end()); + + ns = sendto(sock, audio_packet_out.data(), sizeof(rtp_header_t) + g_txUASAudio.getSrtpPayloadSize(), MSG_DONTWAIT, (sockaddr *) (void *) &remote_rtp_addr, len); + } if (ns != nr) { pthread_mutex_lock(&debugremutexaudio); @@ -2890,6 +3464,8 @@ void rtpstream_videoecho_thread(void* param) { int exit_code = 0; #ifdef USE_TLS + bool rx_auth_tag_present = false; + bool tx_auth_tag_present = false; my_unique_ptr msg { reinterpret_cast(malloc(media_bufsize)) }; ssize_t nr; @@ -2910,6 +3486,9 @@ void rtpstream_videoecho_thread(void* param) unsigned short host_seqnum = 0; unsigned int host_timestamp = 0; unsigned int host_ssrc = 0; + std::vector::iterator it = video_packet_in.begin(); + std::vector::iterator it_payload_begin = video_packet_in.begin(); + std::vector::iterator it_payload_end = video_packet_in.end(); bool abnormal_termination = false; quit_videoecho_thread = false; ParamPass p; @@ -2924,6 +3503,24 @@ void rtpstream_videoecho_thread(void* param) sock = p.i; } + if (g_rxUASVideo.getCryptoTag() != 0) + { + rx_auth_tag_present = true; + } + else + { + rx_auth_tag_present = false; + } + + if (g_txUASVideo.getCryptoTag() != 0) + { + tx_auth_tag_present = true; + } + else + { + tx_auth_tag_present = false; + } + if ((flags = fcntl(sock, F_GETFL, 0)) < 0) { pthread_mutex_lock(&debugremutexvideo); @@ -2970,7 +3567,14 @@ void rtpstream_videoecho_thread(void* param) nr = 0; memset(msg.get(), 0, media_bufsize); len = sizeof(remote_rtp_addr); - video_packet_in.resize(sizeof(rtp_header_t) + g_rxUASVideo.getSrtpPayloadSize() + g_rxUASVideo.getAuthenticationTagSize(), 0); + if (rx_auth_tag_present) + { + video_packet_in.resize(sizeof(rtp_header_t) + g_rxUASVideo.getSrtpPayloadSize() + g_rxUASVideo.getAuthenticationTagSize(), 0); + } + else + { + video_packet_in.resize(sizeof(rtp_header_t) + g_rxUASVideo.getSrtpPayloadSize(), 0); + } nr = recvfrom(sock, video_packet_in.data(), video_packet_in.size(), MSG_DONTWAIT /* NON-BLOCKING */, (sockaddr *) (void *) &remote_rtp_addr, &len); if (nr >= 0) { @@ -2996,7 +3600,7 @@ void rtpstream_videoecho_thread(void* param) } pthread_mutex_unlock(&debugremutexvideo); - if (g_rxUASVideo.getCryptoTag() != 0) + if (rx_auth_tag_present) { rtp_header.clear(); payload_data.clear(); @@ -3031,11 +3635,29 @@ void rtpstream_videoecho_thread(void* param) memcpy(msg.get(), rtp_header.data(), rtp_header.size()); memcpy(msg.get() + sizeof(rtp_header_t), payload_data.data(), payload_data.size()); } + else + { + it = video_packet_in.begin(); + it_payload_begin = video_packet_in.begin(); + it_payload_end = video_packet_in.end(); + unsigned int header_payload_size = 0; - if (g_txUASVideo.getCryptoTag() != 0) + header_payload_size = sizeof(rtp_header_t) + g_rxUASVideo.getSrtpPayloadSize(); + rtp_header.clear(); + payload_data.clear(); + + std::advance(it, sizeof(rtp_header_t)); + rtp_header.assign(video_packet_in.begin(), it); // Fetch leading 12 bytes + + std::advance(it_payload_begin, sizeof(rtp_header_t)); + std::advance(it_payload_end, header_payload_size); + payload_data.assign(it_payload_begin, it_payload_end); // Fetch payload bytes + } + + if (tx_auth_tag_present) { video_packet_out.clear(); - // ENCRYPT + // GRAB RTP HEADER rtp_header.resize(sizeof(rtp_header_t), 0); memcpy(rtp_header.data(), msg.get(), sizeof(rtp_header_t) /*12*/); @@ -3052,9 +3674,18 @@ void rtpstream_videoecho_thread(void* param) fprintf(debugrefilevideo, "TXUASVIDEO -- processOutgoingPacket() rc == %d\n", rc); } pthread_mutex_unlock(&debugremutexvideo); + ns = sendto(sock, video_packet_out.data(), sizeof(rtp_header_t) + g_txUASVideo.getSrtpPayloadSize() + g_txUASVideo.getAuthenticationTagSize(), MSG_DONTWAIT, (sockaddr *) (void *) &remote_rtp_addr, len); } + else + { + video_packet_out.clear(); - ns = sendto(sock, video_packet_out.data(), sizeof(rtp_header_t) + g_txUASVideo.getSrtpPayloadSize() + g_txUASVideo.getAuthenticationTagSize(), MSG_DONTWAIT, (sockaddr *) (void *) &remote_rtp_addr, len); + // ASSEMBLE PACKET + video_packet_out.insert(video_packet_out.end(), rtp_header.begin(), rtp_header.end()); + video_packet_out.insert(video_packet_out.end(), payload_data.begin(), payload_data.end()); + + ns = sendto(sock, video_packet_out.data(), sizeof(rtp_header_t) + g_txUASVideo.getSrtpPayloadSize(), MSG_DONTWAIT, (sockaddr *) (void *) &remote_rtp_addr, len); + } if (ns != nr) { pthread_mutex_lock(&debugremutexvideo); @@ -3082,7 +3713,7 @@ void rtpstream_videoecho_thread(void* param) //pthread_mutex_lock(&debugremutexvideo); //if (debugrefilevideo != nullptr) //{ - //fprintf(debugrefilevideo, "No activity on videoecho socket (EAGAIN)...\n"); + // fprintf(debugrefilevideo, "No activity on videoecho socket (EAGAIN)...\n"); //} //pthread_mutex_unlock(&debugremutexvideo); } @@ -3220,7 +3851,9 @@ int rtpstream_rtpecho_updateaudio(rtpstream_callinfo_t* callinfo, JLSRTP& rxUASA } #ifdef USE_TLS - taskinfo->audio_srtp_echo_active = 1; + ParamPass p; + ResultCheck r; + bool rotate = false; pthread_mutex_lock(&debugremutexaudio); if (debugrefileaudio != nullptr) @@ -3231,10 +3864,81 @@ int rtpstream_rtpecho_updateaudio(rtpstream_callinfo_t* callinfo, JLSRTP& rxUASA printRemoteAudioSrtpStuff(taskinfo->remote_srtp_audio_params); pthread_mutex_unlock(&debugremutexaudio); - pthread_mutex_lock(&uasAudioMutex); - g_rxUASAudio = rxUASAudio; - g_txUASAudio = txUASAudio; - pthread_mutex_unlock(&uasAudioMutex); + pthread_mutex_lock(&portrotation_uas_mutexaudio); + rotate = portrotation_uas_audioecho_thread; + pthread_mutex_unlock(&portrotation_uas_mutexaudio); + + if (rotate) { + taskinfo->audio_srtp_echo_active = 0; + + pthread_mutex_lock(&quit_mutexaudio); + + pthread_mutex_lock(&debugremutexaudio); + if (debugrefileaudio != nullptr) + { + fprintf(debugrefileaudio, "MAIN: Setting quit_audioecho_thread flag to TRUE to PERFORM AUDIO PORT ROTATION...\n"); + } + pthread_mutex_unlock(&debugremutexaudio); + quit_audioecho_thread = true; + pthread_mutex_lock(&debugremutexaudio); + if (debugrefileaudio != nullptr) + { + fprintf(debugrefileaudio, "MAIN: Sending QUIT signal to PERFORM AUDIO PORT ROTATION...\n"); + } + pthread_mutex_unlock(&debugremutexaudio); + pthread_cond_signal(&quit_cvaudio); + + pthread_mutex_unlock(&quit_mutexaudio); + + if (pthread_join(pthread_audioecho_id, &r.p) == 0) + { + // successfully joined audio thread + pthread_mutex_lock(&debugremutexaudio); + if (debugrefileaudio != nullptr) + { + fprintf(debugrefileaudio, "successfully joined audio thread: %d to PERFORM AUDIO PORT ROTATION...\n", r.i); + } + pthread_mutex_unlock(&debugremutexaudio); + } + else + { + // error joining audio thread + pthread_mutex_lock(&debugremutexaudio); + if (debugrefileaudio != nullptr) + { + fprintf(debugrefileaudio, "error joining audio thread: %d to PERFORM AUDIO PORT ROTATION...\n", r.i); + } + pthread_mutex_unlock(&debugremutexaudio); + } + + taskinfo->audio_srtp_echo_active = 1; + + pthread_mutex_lock(&uasAudioMutex); + g_rxUASAudio = rxUASAudio; + g_txUASAudio = txUASAudio; + pthread_mutex_unlock(&uasAudioMutex); + + p.i = taskinfo->audio_rtp_socket; + + if (taskinfo->audio_rtp_socket > 0) { + if (pthread_create(&pthread_audioecho_id, nullptr, (void *(*) (void *)) rtpstream_audioecho_thread, p.p) == -1) { + ERROR_NO("Unable to recreate RTP audio echo thread"); + return -7; + } + } + + pthread_mutex_lock(&portrotation_uas_mutexaudio); + portrotation_uas_audioecho_thread = false; + pthread_mutex_unlock(&portrotation_uas_mutexaudio); + rotate = false; + } else { + taskinfo->audio_srtp_echo_active = 1; + + pthread_mutex_lock(&uasAudioMutex); + g_rxUASAudio = rxUASAudio; + g_txUASAudio = txUASAudio; + pthread_mutex_unlock(&uasAudioMutex); + } #endif // USE_TLS return 0; @@ -3393,7 +4097,9 @@ int rtpstream_rtpecho_updatevideo(rtpstream_callinfo_t* callinfo, JLSRTP& rxUASV } #ifdef USE_TLS - taskinfo->video_srtp_echo_active = 1; + ParamPass p; + ResultCheck r; + bool rotate = false; pthread_mutex_lock(&debugremutexvideo); if (debugrefilevideo != nullptr) @@ -3404,10 +4110,81 @@ int rtpstream_rtpecho_updatevideo(rtpstream_callinfo_t* callinfo, JLSRTP& rxUASV printRemoteVideoSrtpStuff(taskinfo->remote_srtp_video_params); pthread_mutex_unlock(&debugremutexvideo); - pthread_mutex_lock(&uasVideoMutex); - g_rxUASVideo = rxUASVideo; - g_txUASVideo = txUASVideo; - pthread_mutex_unlock(&uasVideoMutex); + pthread_mutex_lock(&portrotation_uas_mutexvideo); + rotate = portrotation_uas_videoecho_thread; + pthread_mutex_unlock(&portrotation_uas_mutexvideo); + + if (rotate) { + taskinfo->video_srtp_echo_active = 0; + + pthread_mutex_lock(&quit_mutexvideo); + + pthread_mutex_lock(&debugremutexvideo); + if (debugrefilevideo != nullptr) + { + fprintf(debugrefilevideo, "MAIN: Setting quit_videoecho_thread flag to TRUE to PERFORM VIDEO PORT ROTATION...\n"); + } + pthread_mutex_unlock(&debugremutexvideo); + quit_videoecho_thread = true; + pthread_mutex_lock(&debugremutexvideo); + if (debugrefilevideo != nullptr) + { + fprintf(debugrefilevideo, "MAIN: Sending QUIT signal to PERFORM VIDEO PORT ROTATION...\n"); + } + pthread_mutex_unlock(&debugremutexvideo); + pthread_cond_signal(&quit_cvvideo); + + pthread_mutex_unlock(&quit_mutexvideo); + + if (pthread_join(pthread_videoecho_id, &r.p) == 0) + { + // successfully joined video thread + pthread_mutex_lock(&debugremutexvideo); + if (debugrefilevideo != nullptr) + { + fprintf(debugrefilevideo, "successfully joined video thread: %d to PERFORM VIDEO PORT ROTATION...\n", r.i); + } + pthread_mutex_unlock(&debugremutexvideo); + } + else + { + // error joining video thread + pthread_mutex_lock(&debugremutexvideo); + if (debugrefilevideo != nullptr) + { + fprintf(debugrefilevideo, "error joining video thread: %d to PERFORM VIDEO PORT ROTATION...\n", r.i); + } + pthread_mutex_unlock(&debugremutexvideo); + } + + taskinfo->video_srtp_echo_active = 1; + + pthread_mutex_lock(&uasVideoMutex); + g_rxUASVideo = rxUASVideo; + g_txUASVideo = txUASVideo; + pthread_mutex_unlock(&uasVideoMutex); + + p.i = taskinfo->video_rtp_socket; + + if (taskinfo->video_rtp_socket > 0) { + if (pthread_create(&pthread_videoecho_id, nullptr, (void *(*) (void *)) rtpstream_videoecho_thread, p.p) == -1) { + ERROR_NO("Unable to recreate RTP video echo thread"); + return -7; + } + } + + pthread_mutex_lock(&portrotation_uas_mutexvideo); + portrotation_uas_videoecho_thread = false; + pthread_mutex_unlock(&portrotation_uas_mutexvideo); + rotate = false; + } else { + taskinfo->video_srtp_echo_active = 1; + + pthread_mutex_lock(&uasVideoMutex); + g_rxUASVideo = rxUASVideo; + g_txUASVideo = txUASVideo; + pthread_mutex_unlock(&uasVideoMutex); + } #endif // USE_TLS return 0; diff --git a/src/sipp.cpp b/src/sipp.cpp index 284974ec..8e9cb86f 100644 --- a/src/sipp.cpp +++ b/src/sipp.cpp @@ -293,9 +293,13 @@ struct sipp_option options_table[] = { "RTP/UDP packets coming on this port + 2 are also echoed to their sender (used for sound and video echo).", SIPP_OPTION_SETFLAG, &rtp_echo_enabled, 1}, {"mb", "Set the RTP echo buffer size (default: 2048).", SIPP_OPTION_INT, &media_bufsize, 1}, - {"min_rtp_port", "Minimum port number for RTP socket range.", SIPP_OPTION_INT, &min_rtp_port, 1}, - {"max_rtp_port", "Maximum port number for RTP socket range.", SIPP_OPTION_INT, &max_rtp_port, 1}, - {"mp", "Sets -min_rtp_port for backwards compatibility.", SIPP_OPTION_INT, &min_rtp_port, 1}, + {"min_rtp_audio_port", "Minimum port number for RTP AUDIO socket range.", SIPP_OPTION_INT, &min_rtp_audio_port, 1}, + {"max_rtp_audio_port", "Maximum port number for RTP AUDIO socket range.", SIPP_OPTION_INT, &max_rtp_audio_port, 1}, + {"min_rtp_video_port", "Minimum port number for RTP VIDEO socket range.", SIPP_OPTION_INT, &min_rtp_video_port, 1}, + {"max_rtp_video_port", "Maximum port number for RTP VIDEO socket range.", SIPP_OPTION_INT, &max_rtp_video_port, 1}, + {"min_udp_image_port", "Minimum port number for UDP IMAGE socket range.", SIPP_OPTION_INT, &min_udp_image_port, 1}, + {"max_udp_image_port", "Maximum port number for UDP IMAGE socket range.", SIPP_OPTION_INT, &max_udp_image_port, 1}, + {"mp", "Sets -min_rtp_audio_port for backwards compatibility.", SIPP_OPTION_INT, &min_rtp_audio_port, 1}, {"rtp_payload", "RTP default payload type.", SIPP_OPTION_INT, &rtp_default_payload, 1}, {"rtp_threadtasks", "RTP number of playback tasks per thread.", SIPP_OPTION_INT, &rtp_tasks_per_thread, 1}, {"rtp_buffsize", "Set the rtp socket send/receive buffer size.", SIPP_OPTION_INT, &rtp_buffsize, 1}, @@ -1206,8 +1210,7 @@ static void sighandle_set() sigaction(SIGXFSZ, &action_file_size_exceeded, nullptr); // avoid core dump if the max file size is exceeded } -static int create_socket(struct sockaddr_storage* media_sa, int try_port, bool last_attempt, - const char *type) +static int create_socket(struct sockaddr_storage* media_sa, int try_port, const char* type) { int s = socket(media_sa->ss_family, SOCK_DGRAM, IPPROTO_UDP); if (s == -1) { @@ -1220,47 +1223,68 @@ static int create_socket(struct sockaddr_storage* media_sa, int try_port, bool l (_RCAST(struct sockaddr_in6*, media_sa))->sin6_port = htons(try_port); } - if (::bind(s, (sockaddr*)media_sa, socklen_from_addr(media_sa)) != 0) { + return s; +} + +static int bind_socket(int media_socket, struct sockaddr_storage* media_sa) +{ + int rc = -1; + + rc = ::bind(media_socket, (sockaddr*)media_sa, socklen_from_addr(media_sa)); + + return rc; +} + +/** + * Create/bind media_socket_audio on given try_port + * (try_port+1 is reserved for RTCP audio) + * Sets: media_socket_audio + */ +static int bind_rtp_audio_socket(struct sockaddr_storage* media_sa, int try_port, bool last_attempt) +{ + int retVal = -1; + + media_socket_audio = create_socket(media_sa, try_port, "audio"); + if(bind_socket(media_socket_audio, media_sa) != 0) { if (last_attempt) { - ERROR_NO("Unable to bind %s RTP socket (IP=%s, port=%d)", type, media_ip, try_port); + ERROR_NO("Unable to bind %s RTP socket (IP=%s, port=%d)", "audio", media_ip, try_port); } - ::close(s); - return -1; + ::close(media_socket_audio); + retVal = -1; + } else { + retVal = 0; } - return s; + + return retVal; } /** - * Create and bind media_socket_audio, media_socket_video for RTP and - * RCTP on try_port and try_port+2. - * - * Sets: media_socket_audio and media_socket_video. + * Create/bind media_socket_video on given try_port + * (try_port+1 is reserved for RTCP video) + * Sets: media_socket_video */ -static int bind_rtp_sockets(struct sockaddr_storage* media_sa, int try_port, bool last_attempt) +static int bind_rtp_video_socket(struct sockaddr_storage* media_sa, int try_port, bool last_attempt) { - /* Create RTP sockets for audio and video. */ - media_socket_audio = create_socket(media_sa, try_port, last_attempt, "audio"); - if (media_socket_audio == -1) { - return -1; - } + int retVal = -1; - /* Create and bind the second/video socket to try_port+2 */ - /* (+1 is reserved for RTCP) */ - media_socket_video = create_socket(media_sa, try_port + 2, last_attempt, "video"); - if (media_socket_video == -1) { - ::close(media_socket_audio); - media_socket_audio = -1; - return -1; + media_socket_video = create_socket(media_sa, try_port, "video"); + if(bind_socket(media_socket_video, media_sa) != 0) { + if (last_attempt) { + ERROR_NO("Unable to bind %s RTP socket (IP=%s, port=%d)", "video", media_ip, try_port); + } + ::close(media_socket_video); + retVal = -1; + } else { + retVal = 0; } - return 0; + return retVal; } /** * Set a bunch of globals and bind audio and video rtp sockets. * - * Sets: media_ip, media_port, media_ip_is_ipv6, media_socket_audio, - * media_socket_video. + * Sets: media_ip, media_audio_port, media_video_port, media_image_port, media_ip_is_ipv6, media_socket_audio, media_socket_video. */ static void setup_media_sockets() { @@ -1268,9 +1292,12 @@ static void setup_media_sockets() struct addrinfo* local_addr; struct sockaddr_storage media_sockaddr = {0,}; int try_counter = 0; - int max_tries = (min_rtp_port < (max_rtp_port - 2)) ? 100 : 1; + int max_audio_tries = (min_rtp_audio_port < (max_rtp_audio_port - 2)) ? 100 : 1; + int max_video_tries = (min_rtp_video_port < (max_rtp_video_port - 2)) ? 100 : 1; - media_port = min_rtp_port; + media_audio_port = min_rtp_audio_port; + media_video_port = min_rtp_video_port; + media_image_port = min_udp_image_port; // [JLTAG] // @@ -1306,11 +1333,24 @@ static void setup_media_sockets() media_socket_video = -1; if (rtp_echo_enabled) { - for (try_counter = 1; try_counter <= max_tries; try_counter++) { - const bool last_attempt = ( - try_counter == max_tries || media_port >= (max_rtp_port - 2)); + for (try_counter = 1; try_counter <= max_audio_tries; try_counter++) { + const bool last_audio_attempt = (try_counter == max_audio_tries || media_audio_port >= (max_rtp_audio_port - 2)); + + if (bind_rtp_audio_socket(&media_sockaddr, media_audio_port, last_audio_attempt) == 0) { + break; + } + + // Old RFC 3551 says: + // > RTP data SHOULD be carried on an even UDP port number and + // > the corresponding RTCP packets SHOULD be carried on the + // > next higher (odd) port number. + // So, try only even numbers. + media_audio_port += 2; + } + for (try_counter = 1; try_counter <= max_video_tries; try_counter++) { + const bool last_video_attempt = (try_counter == max_video_tries || media_video_port >= (max_rtp_video_port - 2)); - if (bind_rtp_sockets(&media_sockaddr, media_port, last_attempt) == 0) { + if (bind_rtp_video_socket(&media_sockaddr, media_video_port, last_video_attempt) == 0) { break; } @@ -1319,7 +1359,7 @@ static void setup_media_sockets() // > the corresponding RTCP packets SHOULD be carried on the // > next higher (odd) port number. // So, try only even numbers. - media_port += 2; + media_video_port += 2; } } }