<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6012">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Jenkins2: Verified
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res/res_pjsip_t38 ensure t38 requests get rejected quickly<br><br>arm the t38 webhook always, so we can correctly reject a<br>T38 negotiation request when t38 is disabled on a channel<br><br>Change-Id: Ib1ffe35aee145d4e0fe61dd012580be11aae079d<br>---<br>M res/res_pjsip_t38.c<br>1 file changed, 14 insertions(+), 12 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c<br>index a032bb1..5fc5597 100644<br>--- a/res/res_pjsip_t38.c<br>+++ b/res/res_pjsip_t38.c<br>@@ -497,16 +497,21 @@<br> return f;<br> }<br> <br>- if (f->frametype == AST_FRAME_CONTROL && f->subclass.integer == AST_CONTROL_T38_PARAMETERS &&<br>- channel->session->endpoint->media.t38.enabled) {<br>- struct t38_parameters_task_data *data = t38_parameters_task_data_alloc(channel->session, f);<br>+ if (f->frametype == AST_FRAME_CONTROL && f->subclass.integer == AST_CONTROL_T38_PARAMETERS) {<br>+ if (channel->session->endpoint->media.t38.enabled) {<br>+ struct t38_parameters_task_data *data = t38_parameters_task_data_alloc(channel->session, f);<br> <br>- if (!data) {<br>- return f;<br>- }<br>+ if (!data) {<br>+ return f;<br>+ }<br> <br>- if (ast_sip_push_task(channel->session->serializer, t38_interpret_parameters, data)) {<br>- ao2_ref(data, -1);<br>+ if (ast_sip_push_task(channel->session->serializer, t38_interpret_parameters, data)) {<br>+ ao2_ref(data, -1);<br>+ }<br>+ } else {<br>+ struct ast_control_t38_parameters parameters = { .request_response = AST_T38_REFUSED, };<br>+ ast_debug(2, "T.38 support not enabled, rejecting T.38 control packet\n");<br>+ ast_queue_control_data(chan, AST_CONTROL_T38_PARAMETERS, ¶meters, sizeof(parameters));<br> }<br> }<br> <br>@@ -551,10 +556,7 @@<br> return;<br> }<br> <br>- /* Only attach the framehook if t38 is enabled for the endpoint */<br>- if (!session->endpoint->media.t38.enabled) {<br>- return;<br>- }<br>+ /* Always attach the framehook so we can quickly reject */<br> <br> ast_channel_lock(session->channel);<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6012">change 6012</a>. To unsubscribe, 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/6012"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ib1ffe35aee145d4e0fe61dd012580be11aae079d </div>
<div style="display:none"> Gerrit-Change-Number: 6012 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Torrey Searle <tsearle@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>