<p>Joshua Colp <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14618">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  George Joseph: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">PJSIP_MEDIA_OFFER: override configuration on refresh<br><br>When using the PSJIP_MEDIA_OFFER dialplan function it was not<br>overriding an endpoint's configured codecs on refresh unless<br>they had a shared codec between the two.<br><br>This patch makes it so whatever is set using PJSIP_MEDIA_OFFER<br>is used when creating the SDP for a refresh no matter what.<br><br>ASTERISK-28878 #close<br><br>Change-Id: I0f7dc86fd0fb607c308e6f98ede303c54d1eacb6<br>---<br>M channels/pjsip/dialplan_functions.c<br>M res/res_pjsip_session.c<br>2 files changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/pjsip/dialplan_functions.c b/channels/pjsip/dialplan_functions.c</span><br><span>index 2ace3ad..721f47f 100644</span><br><span>--- a/channels/pjsip/dialplan_functions.c</span><br><span>+++ b/channels/pjsip/dialplan_functions.c</span><br><span>@@ -1363,6 +1363,7 @@</span><br><span>  ast_format_cap_remove_by_type(caps, data->media_type);</span><br><span>    ast_format_cap_update_by_allow_disallow(caps, data->value, 1);</span><br><span>    ast_stream_set_formats(stream, caps);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_stream_set_metadata(stream, "pjsip_session_refresh", "force");</span><br><span>       ao2_ref(caps, -1);</span><br><span> </span><br><span>       return 0;</span><br><span>diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c</span><br><span>index 2bf69f1..980a1e9 100644</span><br><span>--- a/res/res_pjsip_session.c</span><br><span>+++ b/res/res_pjsip_session.c</span><br><span>@@ -1730,7 +1730,8 @@</span><br><span>                           }</span><br><span> </span><br><span>                                /* Enforce the configured allowed codecs on audio and video streams */</span><br><span style="color: hsl(0, 100%, 40%);">-                          if (ast_stream_get_type(stream) == AST_MEDIA_TYPE_AUDIO || ast_stream_get_type(stream) == AST_MEDIA_TYPE_VIDEO) {</span><br><span style="color: hsl(120, 100%, 40%);">+                             if ((ast_stream_get_type(stream) == AST_MEDIA_TYPE_AUDIO || ast_stream_get_type(stream) == AST_MEDIA_TYPE_VIDEO) &&</span><br><span style="color: hsl(120, 100%, 40%);">+                                   !ast_stream_get_metadata(stream, "pjsip_session_refresh")) {</span><br><span>                                       struct ast_format_cap *joint_cap;</span><br><span> </span><br><span>                                        joint_cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14618">change 14618</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14618"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: I0f7dc86fd0fb607c308e6f98ede303c54d1eacb6 </div>
<div style="display:none"> Gerrit-Change-Number: 14618 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>