Hi,<br><br>Yes, I meant ast_autoservice_stop... my mistake when writting.<br><br>I did a quick test using SVN 1.4 branch and the problem was gone.<br><br>Thanks!<br><br><br>Paulo<br><br><div class="gmail_quote">On Dec 12, 2007 3:04 AM, Dmitry Andrianov &lt;
<a href="mailto:dimas@dataart.com">dimas@dataart.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">








<div link="blue" vlink="purple" lang="RU">

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">I guess you meant ast_autoservice_stop not ast_service_stop.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">Honestly I have no idea what causes your problem – it is
something for Russell to look at probably.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">However, I'm almost sure that upgrading tor latest SVN 1.4
branch will fix the problem because of commit 90967.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">&nbsp;</span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">

<p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:asterisk-dev-bounces@lists.digium.com" target="_blank">asterisk-dev-bounces@lists.digium.com</a>

[mailto:<a href="mailto:asterisk-dev-bounces@lists.digium.com" target="_blank">asterisk-dev-bounces@lists.digium.com</a>] <b>On Behalf Of </b>Paulo Garcia<br>
<b>Sent:</b> Tuesday, December 11, 2007 10:44 PM<br>
<b>To:</b> Asterisk Developers Mailing List<br>
<b>Subject:</b> [asterisk-dev] Asterisk 1.4.15 ast_service_stop() function
deadlock?</span></p>

</div><div><div></div><div class="Wj3C7c">

<p>&nbsp;</p>

<p style="margin-bottom: 12pt;">Hi,<br>
<br>
well, it isn&#39;t really a deadlock, but I think it is something wrong....<br>
<br>
in my channel driver, I have a fax detection procedure that calls
ast_exists_extensions() to check if there is a &#39;fax&#39; exten available to jump
for. <br>
<br>
My test environment is an Asterisk box with FXO interface and another
non-asterisk box with FXS interface. The FXS side originates the call and the
asterisk box answer the call.<br>
<br>
I always used the following dialplan for testing: <br>
<br>
exten =&gt; s,1,Answer(1000);<br>
exten =&gt; s,n,Record(test:ulaw|0|0)<br>
exten =&gt; s,n,NoOp(${REMOTESTATIONID})<br>
<br>
When the Asterisk side answer the call, the FXS side starts a Fax transmit. Of
course the fax won&#39;t be received since there is no Rx application running on
Asterisk side. <br>
<br>
The problem is that, when the Asterisk detects the fax signal and calls
ast_exists_extensions(), the function ast_service_stop() only returns when the
call finishes. I followed the stack and it seems that the ast_service_stop
function stay the following point: </p>

<pre>00234&nbsp;&nbsp;&nbsp; <span>/* Wait for it to un-block */</span></pre><pre><a name="116ccc3db3db537f_l00235"></a>00235&nbsp;&nbsp;&nbsp; <span>while</span> (<a href="http://www.asterisk.org/doxygen/1.4/utils_8h.html#0cba63300a5690b7f297b26179882cd9" target="_blank">
ast_test_flag</a>(<a href="http://www.asterisk.org/doxygen/1.4/structasent.html#24fea160601399d6d7a15f28b22bebd7" target="_blank"></a></pre><pre><span><a href="http://www.asterisk.org/doxygen/1.4/structasent.html#24fea160601399d6d7a15f28b22bebd7" target="_blank">
chan</a></span>, <a href="http://www.asterisk.org/doxygen/1.4/channel_8h.html#d032a9ab2ed31c90af611a3c6221925306284ba3d5b82164197739aff2f52568" target="_blank">AST_FLAG_BLOCKING</a>))<br>
<a name="116ccc3db3db537f_l00236"></a>00236&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; usleep(1000);</pre>

<p style="margin-bottom: 12pt;"><br>
So, If my call takes 3 minutes, the Asterisk will stay on that point for 3
minutes and return only to hangup.<br>
<br>
Also, I tested using Asterisk 1.4.14 and this problem doesn&#39;t happen. I saw
that 1.4.15 has a lot of changes on that function, to keep dtmf frames but I
couldn&#39;t figure out why these changes starts to cause the problem in 1.4.15
since that loop exists on both versions.<br>
<br>
Any idea?<br clear="all">
<br>
<i>Note: I used the Record() application because it has the same loop to wait
finish that my fax rx application has. I swapped them to be sure that it is not
only a problem in my application. <br>
</i><br>
-- <br>
--------------<br>
Paulo Garcia</p>

</div></div></div>

</div>


<br>_______________________________________________<br>--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--" target="_blank">http://www.api-digital.com--</a><br><br>asterisk-dev mailing list<br>To UNSUBSCRIBE or update options visit:
<br> &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br><br clear="all"><br>