From 4359a386e5dcded7779dcb5e6ddc4ae3477b47b3 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Tue, 5 Jun 2018 09:36:35 +0000 Subject: [PATCH] rtp: Don't negotiate dynamic codecs using payload. In Asterisk there are some dynamic codecs that have a fixed payload number. This number was being improperly used to negotiate the codec, instead of using the name and sample rate. This could result in the wrong payload number being negotiated for a codec. This change makes it so that only static payloads will be negotiated using their payload number. ASTERISK-27848 Change-Id: Ia865830170fd3f808cdb33104f3d4c4ffdc77570 --- main/rtp_engine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/rtp_engine.c b/main/rtp_engine.c index 44f5104112..5a7ec824db 100644 --- a/main/rtp_engine.c +++ b/main/rtp_engine.c @@ -1281,7 +1281,7 @@ void ast_rtp_codecs_payloads_set_m_type(struct ast_rtp_codecs *codecs, struct as { struct ast_rtp_payload_type *new_type; - if (payload < 0 || payload >= AST_RTP_MAX_PT) { + if (payload < 0 || payload >= AST_RTP_MAX_PT || payload > AST_RTP_PT_LAST_STATIC) { return; } -- 2.47.3