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
{
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;
}