--- res/res_pjsip_sdp_rtp.c (Asterisk 13.15.0) +++ res/res_pjsip_sdp_rtp.c (working copy) @@ -431,2 +431,3 @@ { + extern pj_bool_t pjsip_use_compact_form; pjmedia_sdp_rtpmap rtpmap; @@ -439,2 +440,7 @@ pj_strdup2(pool, &media->desc.fmt[media->desc.fmt_count++], tmp); + + if (35 > rtp_code && pjsip_use_compact_form) { + return NULL; + } + rtpmap.pt = media->desc.fmt[media->desc.fmt_count - 1]; @@ -1230,7 +1236,5 @@ - if (!(attr = generate_rtpmap_attr(session, media, pool, rtp_code, 1, format, 0))) { - ao2_ref(format, -1); - continue; + if ((attr = generate_rtpmap_attr(session, media, pool, rtp_code, 1, format, 0))) { + media->attr[media->attr_count++] = attr; } - media->attr[media->attr_count++] = attr; @@ -1263,8 +1267,6 @@ - if (!(attr = generate_rtpmap_attr(session, media, pool, rtp_code, 0, NULL, index))) { - continue; + if ((attr = generate_rtpmap_attr(session, media, pool, rtp_code, 0, NULL, index))) { + media->attr[media->attr_count++] = attr; } - media->attr[media->attr_count++] = attr; - if (index == AST_RTP_DTMF) {