<p>Torrey Searle has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6012">View Change</a></p><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;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/12/6012/1</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..43444b0 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 (session->endpoint->media.t38.enabled) {<br>+ struct t38_parameters_task_data *data = t38_parameters_task_data_alloc(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(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(session->channel, 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: newchange </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: 1 </div>
<div style="display:none"> Gerrit-Owner: Torrey Searle <tsearle@gmail.com> </div>