summaryrefslogtreecommitdiff
path: root/main/rtp_engine.c
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2017-04-10 12:13:39 +0200
committerAlexander Traud <pabstraud@compuserve.com>2017-04-13 11:05:25 +0200
commit72c5f3b0ba40e352fa26eeeead6e72eabd5e7730 (patch)
tree391b7a632d64ff75a1bd72e3de9e9d084a6aad64 /main/rtp_engine.c
parent62386dd1df85d0a9dc8b854836ad77e67bb1d56f (diff)
res_pjsip_sdp_rtp: No rtpmap for static RTP payload IDs in SDP.
This saves around 100 bytes when G.711, G.722, G.729, and GSM are advertised in SDP. This reduces the chance to hit the MTU bearer of 1300 bytes for SIP over UDP, if many codecs are allowed in Asterisk. This new feature is enabled together with the optional feature compact_headers=yes via the file pjsip.conf. ASTERISK-26932 #close Change-Id: Iaa556ab4c8325cd34c334387ab2847fab07b1689
Diffstat (limited to 'main/rtp_engine.c')
-rw-r--r--main/rtp_engine.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index 00f9d595f..19ca31cb6 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -1348,28 +1348,31 @@ static int find_unused_payload(const struct ast_rtp_codecs *codecs)
* https://tools.ietf.org/html/draft-roach-mmusic-unified-plan#section-3.2.1.2
* https://tools.ietf.org/html/draft-wu-avtcore-dynamic-pt-usage#section-3
*/
- res = find_unused_payload_in_range(codecs, MAX(ast_option_rtpptdynamic, 35),
+ res = find_unused_payload_in_range(
+ codecs, MAX(ast_option_rtpptdynamic, AST_RTP_PT_LAST_STATIC + 1),
AST_RTP_PT_LAST_REASSIGN, static_RTP_PT);
if (res != -1) {
return res;
}
- /* Yet, reusing mappings below 35 is not supported in Asterisk because
- * when Compact Headers are activated, no rtpmap is send for those below
- * 35. If you want to use 35 and below
+ /* Yet, reusing mappings below AST_RTP_PT_LAST_STATIC (35) is not supported
+ * in Asterisk because when Compact Headers are activated, no rtpmap is
+ * send for those below 35. If you want to use 35 and below
* A) do not use Compact Headers,
* B) remove that code in chan_sip/res_pjsip, or
* C) add a flag that this RTP Payload Type got reassigned dynamically
* and requires a rtpmap even with Compact Headers enabled.
*/
res = find_unused_payload_in_range(
- codecs, MAX(ast_option_rtpptdynamic, 20), 35, static_RTP_PT);
+ codecs, MAX(ast_option_rtpptdynamic, 20),
+ AST_RTP_PT_LAST_STATIC + 1, static_RTP_PT);
if (res != -1) {
return res;
}
return find_unused_payload_in_range(
- codecs, MAX(ast_option_rtpptdynamic, 0), 20, static_RTP_PT);
+ codecs, MAX(ast_option_rtpptdynamic, 0),
+ 20, static_RTP_PT);
}
/*!