<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/1116/">https://reviewboard.asterisk.org/r/1116/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On October 3rd, 2011, 8:44 a.m., <b>Kevin Fleming</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/1116/diff/29/?file=20971#file20971line3331" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/res/res_fax.c</a>
<span style="font-weight: normal;">
(Diff revision 29)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static struct fax_detect* fax_detect_attach(struct ast_channel *chan, int timeout, int noiselim, int dsp_detect_flags)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">3331</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">ao2_ref</span><span class="p">(</span><span class="n">faxdetect</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">There is already a reference to 'faxdetect' in use here (the one created by fax_detect_new()) which hasn't been released. Why is another reference necessary?
On the line 'fr_hook.data = faxdetect;' that reference is *transferred* to the fr_hook structure.</pre>
</blockquote>
<p>On October 3rd, 2011, 9:46 a.m., <b>irroot</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">this ref is droped by the caller the reason is to allow a program to set up a framehook and then
hold the ref checking returned results after the framehook is gone this may not be required latter.
it also prevents a race condition as im returning the pointer i only unref when ive had my way with it.
the other ref will be held in the framehook while its active it may die at any time. </pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The intention here would be more obvious if the ref count was incremented when you set fr_hook.data = faxdetect. It may also be better to increase the ref count in the ATTACHED event handler inside of the framehook it self.</pre>
<br />
<p>- Matthew</p>
<br />
<p>On October 2nd, 2011, 2:13 p.m., irroot wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers, Russell Bryant, Matthew Nicholson, dimas, may213, Leif Madsen, and dafe_von_cetin.</div>
<div>By irroot.</div>
<p style="color: grey;"><i>Updated Oct. 2, 2011, 2:13 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hi there the patch that was going around circa 2008 to implement this in 1.4/1.6 app_fax has been moved to trunk [1.10]
ive made some cleanups and moved it into res_fax res_fax_spandsp this is the framework and not production code
unfortunately i have no means of testing it at the moment and require help.
i have cleaned the code up substantially it is related to R459
hope this is found useful and aids in the goal to get it in 1.10.
Adds application FaxGateway / FaxDetect
Adds alternate bridge to Dial with new option.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/jira/browse/ASTERISK-18569">ASTERISK-18569</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/trunk/addons/chan_ooh323.c <span style="color: grey">(338905)</span></li>
<li>/trunk/funcs/func_channel.c <span style="color: grey">(338905)</span></li>
<li>/trunk/include/asterisk/res_fax.h <span style="color: grey">(338905)</span></li>
<li>/trunk/res/res_fax.c <span style="color: grey">(338905)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1116/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>