]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
rtp: Don't negotiate dynamic codecs using payload.
authorJoshua Colp <jcolp@digium.com>
Tue, 5 Jun 2018 09:36:35 +0000 (09:36 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 12 Jun 2018 09:51:47 +0000 (03:51 -0600)
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

index c11027af2f11e845c3c1cbd366e37244b7aae5ca..3d507745d39e4ad5ac3128e44e3cd241066649ad 100644 (file)
@@ -1287,7 +1287,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;
        }