summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-08-09 14:54:26 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-08-09 14:54:26 -0500
commitb5eca43b29f0eb33d1e8305a8851a4295e4211b0 (patch)
tree67757840af327a754dd8d0a1f63f98aa569a655f /channels
parent0493f0846894a8b4a597646750d95fdb76686efd (diff)
parentc4f201cd738bacc0cabd29cc75ab29103ed8a84b (diff)
Merge "res_rtp_asterisk: Make P2P bridge Asymmetric codec aware" into 13
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_pjsip.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index db0a69712..7a2ffbcc8 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -727,14 +727,11 @@ static struct ast_frame *chan_pjsip_read(struct ast_channel *ast)
session = channel->session;
- if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), f->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) {
- ast_debug(1, "Oooh, got a frame with format of %s on channel '%s' when it has not been negotiated\n",
- ast_format_get_name(f->subclass.format), ast_channel_name(ast));
-
- ast_frfree(f);
- return &ast_null_frame;
- }
-
+ /*
+ * Asymmetric RTP only has one native format set at a time.
+ * Therefore we need to update the native format to the current
+ * raw read format BEFORE the native format check
+ */
if (!session->endpoint->asymmetric_rtp_codec &&
ast_format_cmp(ast_channel_rawwriteformat(ast), f->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) {
struct ast_format_cap *caps;
@@ -761,6 +758,14 @@ static struct ast_frame *chan_pjsip_read(struct ast_channel *ast)
}
}
+ if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), f->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) {
+ ast_debug(1, "Oooh, got a frame with format of %s on channel '%s' when it has not been negotiated\n",
+ ast_format_get_name(f->subclass.format), ast_channel_name(ast));
+
+ ast_frfree(f);
+ return &ast_null_frame;
+ }
+
if (session->dsp) {
int dsp_features;