[Asterisk-code-review] Add extended properties to rtp engine for RTP retransmission... (asterisk[15])

Joshua Colp asteriskteam at digium.com
Sun Feb 25 19:10:52 CST 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/8383 )

Change subject: Add extended properties to rtp_engine for RTP retransmission support.
......................................................................

Add extended properties to rtp_engine for RTP retransmission support.

A couple of additional properties are needed in rtp_engine to enable
support for packet retransmission: AST_RTP_PROPERTY_RETRANS_RECV and
AST_RTP_PROPERTY_RETRANS_SEND. These will both be enabled automatically
if an endpoint has the webrtc option enabled. While this adds no
functionality currently, it will serve as a building block for future
changes for RTP retransmission support.

For more information, refer to the wiki page:
https://wiki.asterisk.org/wiki/display/AST/WebRTC+User+Experience+Improvements

Change-Id: Ic598acd042a045f9d10e5bdccb66f4efc9e587cc
---
M include/asterisk/rtp_engine.h
M res/res_pjsip_sdp_rtp.c
2 files changed, 11 insertions(+), 4 deletions(-)

Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h
index c77be45..3812cb1 100644
--- a/include/asterisk/rtp_engine.h
+++ b/include/asterisk/rtp_engine.h
@@ -122,6 +122,10 @@
 	AST_RTP_PROPERTY_RTCP,
 	/*! Enable Asymmetric RTP Codecs */
 	AST_RTP_PROPERTY_ASYMMETRIC_CODEC,
+	/*! Enable packet retransmission for received packets */
+	AST_RTP_PROPERTY_RETRANS_RECV,
+	/*! Enable packet retransmission for sent packets */
+	AST_RTP_PROPERTY_RETRANS_SEND,
 
 	/*!
 	 * \brief Maximum number of RTP properties supported
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 9e04119..25ffd16 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -219,10 +219,13 @@
 			(session->endpoint->media.tos_audio || session->endpoint->media.cos_audio)) {
 		ast_rtp_instance_set_qos(session_media->rtp, session->endpoint->media.tos_audio,
 				session->endpoint->media.cos_audio, "SIP RTP Audio");
-	} else if (session_media->type == AST_MEDIA_TYPE_VIDEO &&
-			(session->endpoint->media.tos_video || session->endpoint->media.cos_video)) {
-		ast_rtp_instance_set_qos(session_media->rtp, session->endpoint->media.tos_video,
-				session->endpoint->media.cos_video, "SIP RTP Video");
+	} else if (session_media->type == AST_MEDIA_TYPE_VIDEO) {
+		ast_rtp_instance_set_prop(session_media->rtp, AST_RTP_PROPERTY_RETRANS_RECV, session->endpoint->media.webrtc);
+		ast_rtp_instance_set_prop(session_media->rtp, AST_RTP_PROPERTY_RETRANS_SEND, session->endpoint->media.webrtc);
+		if (session->endpoint->media.tos_video || session->endpoint->media.cos_video) {
+			ast_rtp_instance_set_qos(session_media->rtp, session->endpoint->media.tos_video,
+					session->endpoint->media.cos_video, "SIP RTP Video");
+		}
 	}
 
 	ast_rtp_instance_set_last_rx(session_media->rtp, time(NULL));

-- 
To view, visit https://gerrit.asterisk.org/8383
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic598acd042a045f9d10e5bdccb66f4efc9e587cc
Gerrit-Change-Number: 8383
Gerrit-PatchSet: 2
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180225/ac3ede3b/attachment.html>


More information about the asterisk-code-review mailing list