PJSIP_MEDIA_OFFER: override configuration on refresh

When using the PSJIP_MEDIA_OFFER dialplan function it was not
overriding an endpoint's configured codecs on refresh unless
they had a shared codec between the two.

This patch makes it so whatever is set using PJSIP_MEDIA_OFFER
is used when creating the SDP for a refresh no matter what.

ASTERISK-28878 #close

Change-Id: I0f7dc86fd0fb607c308e6f98ede303c54d1eacb6
This commit is contained in:
Kevin Harwell
2020-06-30 11:08:47 -05:00
committed by Friendly Automation
parent cfed0ea033
commit 4eba6b9eb2
2 changed files with 3 additions and 1 deletions

View File

@@ -1731,7 +1731,8 @@ static int sip_session_refresh(struct ast_sip_session *session,
}
/* Enforce the configured allowed codecs on audio and video streams */
if (ast_stream_get_type(stream) == AST_MEDIA_TYPE_AUDIO || ast_stream_get_type(stream) == AST_MEDIA_TYPE_VIDEO) {
if ((ast_stream_get_type(stream) == AST_MEDIA_TYPE_AUDIO || ast_stream_get_type(stream) == AST_MEDIA_TYPE_VIDEO) &&
!ast_stream_get_metadata(stream, "pjsip_session_refresh")) {
struct ast_format_cap *joint_cap;
joint_cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);