diff options
Diffstat (limited to 'channels/chan_pjsip.c')
-rw-r--r-- | channels/chan_pjsip.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c index ebda6c7ee..4a24fa689 100644 --- a/channels/chan_pjsip.c +++ b/channels/chan_pjsip.c @@ -797,14 +797,13 @@ static struct ast_frame *chan_pjsip_read_stream(struct ast_channel *ast) return f; } - 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; - } + session = channel->session; + /* + * 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; @@ -831,6 +830,14 @@ static struct ast_frame *chan_pjsip_read_stream(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; |