summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 9d5d638ad..22a345767 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13167,10 +13167,11 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
- Then other codecs in capabilities, including video
*/
- /* Prefer the audio codec we were requested to use, first, no matter what
- Note that p->prefcodec can include video codecs, so mask them out
- */
- if (ast_format_cap_has_joint(tmpcap, p->prefcaps)) {
+
+ /* Unless otherwise configured, the prefcaps is added before the peer's
+ * configured codecs.
+ */
+ if (!ast_test_flag(&p->flags[2], SIP_PAGE3_IGNORE_PREFCAPS) && ast_format_cap_has_joint(tmpcap, p->prefcaps)) {
ast_format_cap_iter_start(p->prefcaps);
while (!(ast_format_cap_iter_next(p->prefcaps, &tmp_fmt))) {
if (AST_FORMAT_GET_TYPE(tmp_fmt.id) != AST_FORMAT_TYPE_AUDIO) {
@@ -30766,6 +30767,8 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_USE_AVPF);
} else if (!strcasecmp(v->name, "icesupport")) {
ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_ICE_SUPPORT);
+ } else if (!strcasecmp(v->name, "ignore_requested_pref")) {
+ ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_IGNORE_PREFCAPS);
} else {
ast_rtp_dtls_cfg_parse(&peer->dtls_cfg, v->name, v->value);
}