[Asterisk-code-review] rtp engine: Allow more than 32 dynamic payload types. (asterisk[14])
Alexander Traud
asteriskteam at digium.com
Tue Aug 23 07:23:05 CDT 2016
Alexander Traud has uploaded a new change for review.
https://gerrit.asterisk.org/3682
Change subject: rtp_engine: Allow more than 32 dynamic payload types.
......................................................................
rtp_engine: Allow more than 32 dynamic payload types.
Since adding all remaining rates of Signed Linear (ASTERISK-24274) and SILK
(Gerrit 3136), only one RTP Payload Type in the dynamic range is left (96-127).
RFC 3551 section 3 allows to reassign other ranges. Consequently, when the
dynamic range is exhausted, this change utilizes payload types above 35 giving
room for at least another 54 payload types.
ASTERISK-26311 #close
Change-Id: I7bc96ab764bc30098a178b841cbf7146f9d64964
---
M main/rtp_engine.c
1 file changed, 44 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/82/3682/1
diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index 0671374..e52a552 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -2279,6 +2279,50 @@
break;
}
}
+ /* http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml
+ * RFC 3551, Section 3: "[...] applications which need to define more
+ * than 32 dynamic payload types MAY bind codes below
+ * [AST_RTP_PT_FIRST_DYNAMIC], in which case it is RECOMMENDED that
+ * unassigned payload type numbers be used first."
+ */
+ if (map < 0) {
+ for (x = 77; x < AST_RTP_PT_FIRST_DYNAMIC; ++x) {
+ if (!static_RTP_PT[x]) {
+ map = x;
+ break;
+ }
+ }
+ }
+ if (map < 0) {
+ for (x = 35; x < 77; ++x) {
+ if (!static_RTP_PT[x]) {
+ map = x;
+ break;
+ }
+ }
+ }
+ /* Yet, reusing mappings below 35 is not supported in Asterisk because
+ * when Compact Headers are activated, no rtpmap is send for those below
+ * 35. Therefore, you have to remove that code in chan_sip/res_pjsip or
+ * add a flag that this RTP Payload Type got reassigned dynamically and
+ * and requires a rtpmap even with Compact Headers enabled.
+ if (map < 0) {
+ for (x = 20; x < 35; ++x) {
+ if (!static_RTP_PT[x]) {
+ map = x;
+ break;
+ }
+ }
+ }
+ if (map < 0) {
+ for (x = 0; x < 20; ++x) {
+ if (!static_RTP_PT[x]) {
+ map = x;
+ break;
+ }
+ }
+ }
+ */
if (map < 0) {
if (format) {
--
To view, visit https://gerrit.asterisk.org/3682
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bc96ab764bc30098a178b841cbf7146f9d64964
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
More information about the asterisk-code-review
mailing list