diff --git a/main/format_cap.c b/main/format_cap.c index 15b9f9cbb2..4dc8e49147 100644 --- a/main/format_cap.c +++ b/main/format_cap.c @@ -39,7 +39,6 @@ #include "asterisk/vector.h" #include "asterisk/linkedlists.h" #include "asterisk/utils.h" -#include "asterisk/rtp_engine.h" /*! \brief Structure used for capability formats, adds framing */ struct format_cap_framed { @@ -235,7 +234,7 @@ int ast_format_cap_append_by_type(struct ast_format_cap *cap, enum ast_media_typ format = ast_format_cache_get_by_codec(codec); - if (format == ast_format_none || !ast_rtp_lookup_sample_rate2(1, format, 0)) { + if (format == ast_format_none) { ao2_ref(format, -1); ao2_ref(codec, -1); continue; @@ -366,13 +365,10 @@ int ast_format_cap_update_by_allow_disallow(struct ast_format_cap *cap, const ch } all = strcasecmp(this, "all") ? 0 : 1; - if (!all) { - format = ast_format_cache_get(this); - if (!format || !ast_rtp_lookup_sample_rate2(1, format, 0)) { - ast_log(LOG_WARNING, "Cannot %s unknown format '%s'\n", iter_allowing ? "allow" : "disallow", this); - res = -1; - continue; - } + if (!all && !(format = ast_format_cache_get(this))) { + ast_log(LOG_WARNING, "Cannot %s unknown format '%s'\n", iter_allowing ? "allow" : "disallow", this); + res = -1; + continue; } if (cap) {