mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 11:11:05 +00:00
Merge "res_pjsip_sdp_rtp: Limit number of formats to defined maximum." into 13
This commit is contained in:
@@ -1162,10 +1162,14 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
|
|||||||
max_packet_size = ast_format_get_maximum_ms(format);
|
max_packet_size = ast_format_get_maximum_ms(format);
|
||||||
}
|
}
|
||||||
ao2_ref(format, -1);
|
ao2_ref(format, -1);
|
||||||
|
|
||||||
|
if (media->desc.fmt_count == PJMEDIA_MAX_SDP_FMT) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add non-codec formats */
|
/* Add non-codec formats */
|
||||||
if (media_type != AST_MEDIA_TYPE_VIDEO) {
|
if (media_type != AST_MEDIA_TYPE_VIDEO && media->desc.fmt_count < PJMEDIA_MAX_SDP_FMT) {
|
||||||
for (index = 1LL; index <= AST_RTP_MAX; index <<= 1) {
|
for (index = 1LL; index <= AST_RTP_MAX; index <<= 1) {
|
||||||
if (!(noncodec & index)) {
|
if (!(noncodec & index)) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1187,6 +1191,10 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
|
|||||||
attr = pjmedia_sdp_attr_create(pool, "fmtp", pj_cstr(&stmp, tmp));
|
attr = pjmedia_sdp_attr_create(pool, "fmtp", pj_cstr(&stmp, tmp));
|
||||||
media->attr[media->attr_count++] = attr;
|
media->attr[media->attr_count++] = attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (media->desc.fmt_count == PJMEDIA_MAX_SDP_FMT) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
third-party/pjproject/patches/config_site.h
vendored
6
third-party/pjproject/patches/config_site.h
vendored
@@ -57,3 +57,9 @@
|
|||||||
/* Defaults too low for WebRTC */
|
/* Defaults too low for WebRTC */
|
||||||
#define PJ_ICE_MAX_CAND 32
|
#define PJ_ICE_MAX_CAND 32
|
||||||
#define PJ_ICE_MAX_CHECKS (PJ_ICE_MAX_CAND * 2)
|
#define PJ_ICE_MAX_CHECKS (PJ_ICE_MAX_CAND * 2)
|
||||||
|
|
||||||
|
/* Increase limits to allow more formats */
|
||||||
|
#define PJMEDIA_MAX_SDP_FMT 64
|
||||||
|
#define PJMEDIA_MAX_SDP_BANDW 4
|
||||||
|
#define PJMEDIA_MAX_SDP_ATTR (PJMEDIA_MAX_SDP_FMT*2 + 4)
|
||||||
|
#define PJMEDIA_MAX_SDP_MEDIA 16
|
||||||
|
Reference in New Issue
Block a user