From 39c8d566ad78d9e726b5900f9b14241ec99492fb Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Mon, 11 Dec 2017 18:20:06 -0600 Subject: res_rtp_asterisk.c: Disable packet flood detection for video streams. We should not do flood detection on video RTP streams. Video RTP streams are very bursty by nature. They send out a burst of packets to update the video frame then wait for the next video frame update. Really only audio streams can be checked for flooding. The others are either bursty or don't have a set rate. * Added code to selectively disable packet flood detection for video RTP streams. ASTERISK-27440 Change-Id: I78031491a6e75c2d4b1e9c2462dc498fe9880a70 --- main/rtp_engine.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'main') diff --git a/main/rtp_engine.c b/main/rtp_engine.c index 2431ffc0c..68c53e7ff 100644 --- a/main/rtp_engine.c +++ b/main/rtp_engine.c @@ -1176,6 +1176,25 @@ void ast_rtp_codecs_payloads_unset(struct ast_rtp_codecs *codecs, struct ast_rtp ast_rwlock_unlock(&codecs->codecs_lock); } +enum ast_media_type ast_rtp_codecs_get_stream_type(struct ast_rtp_codecs *codecs) +{ + enum ast_media_type stream_type = AST_MEDIA_TYPE_UNKNOWN; + int payload; + struct ast_rtp_payload_type *type; + + ast_rwlock_rdlock(&codecs->codecs_lock); + for (payload = 0; payload < AST_VECTOR_SIZE(&codecs->payload_mapping_rx); ++payload) { + type = AST_VECTOR_GET(&codecs->payload_mapping_rx, payload); + if (type && type->asterisk_format) { + stream_type = ast_format_get_type(type->format); + break; + } + } + ast_rwlock_unlock(&codecs->codecs_lock); + + return stream_type; +} + struct ast_rtp_payload_type *ast_rtp_codecs_get_payload(struct ast_rtp_codecs *codecs, int payload) { struct ast_rtp_payload_type *type = NULL; -- cgit v1.2.3