easier than you think,<br><br>Just like Traun had suspected, the methods in the C++ wrapper for the read app was missing the begin and end allow threads calls<br>that are only important to python to tell it to suspend the thread state while FS specific code is being executed.<br>
<br>2 line fix in trunk rev 12958<br><br><div class="gmail_quote">On Wed, Apr 8, 2009 at 8:59 PM, Adam Wilt <span dir="ltr">&lt;<a href="mailto:wiltingtree@gmail.com">wiltingtree@gmail.com</a>&gt;</span> 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>Traun, thanks again for your help. </div>
<div>I followed your advice and I made some progress!</div>
<div> </div>
<div>I tested with the latest trunk version and also with 1.0.2, and both exhibited the same behavior.</div>
<div>I then tried writing a test script in Lua, and it worked fine.</div>
<div>So this meant the problem was in the Python module (I was sure it was some FS config issue).</div>
<div>So I started playing with a small test Python script, and I narrowed the problem down to when I&#39;m using the &quot;read&quot; function.</div>
<div>Here is my test script:</div>
<div> </div>
<div>from freeswitch import *</div>
<div>def handler(session, args):</div>
<div>  #answer the call<br>  session.answer();</div>
<div>  #play a file<br>  session.streamFile(&quot;long_prompt.mp3&quot;)</div>
<div>  # Test 1 - FAILED!<br>  digits = session.read(5, 10, &quot;long_prompt.mp3&quot;, 3000, &quot;#&quot;)</div>
<div>  # Test 2 - WORKED OK!<br>  #session.getDigits(1,&quot;#&quot;,7000)<br>  #session.streamFile(&quot;long_prompt.mp3&quot;)</div>
<div>  # TEST 3 - WORKED OK!<br>  #digits = session.playAndGetDigits(5, 10, 1, 60, &quot;#&quot;,&quot;long_prompt.mp3&quot;, &quot;&quot;, &quot;&quot;)</div>
<div>  #hangup<br>  session.hangup();<br></div>
<div>When I uncomment the code under test 1 and I make two simultaneous calls, the initial prompt plays for both calls just fine. But then the second prompt only plays on one of the channels and the other one just has dead air. When the first channel finishes playing the prompt, then the second channel starts playing it.</div>


<div> </div>
<div>Then I re-comment test 1 and uncomment either test 2 or test 3, Both prompts play just fine for both channels.</div>
<div> </div>
<div>So I think there may be a bug in the read() function somewhere.  I took a look at it, but it&#39;s way over my head.</div>
<div> </div>
<div>Thanks again, </div>
<div>Adam</div>
<div> </div>
<div> </div>
<div> </div>
<div>&gt;Message: 8<br>&gt;Date: Thu, 9 Apr 2009 02:36:08 +0430<div class="im"><br>&gt;From: Traun Leyden &lt;<a href="mailto:tleyden@branchcut.com" target="_blank">tleyden@branchcut.com</a>&gt;<br>&gt;Subject: Re: [Freeswitch-users] Two or more simultaneous calls not<br>
</div><div class="im">
&gt;To: <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>&gt;Message-ID:<br></div>&gt;       &lt;<a href="mailto:f9f80d540904081506p3f0647fei4cf843d0b1904bc0@mail.gmail.com" target="_blank">f9f80d540904081506p3f0647fei4cf843d0b1904bc0@mail.gmail.com</a>&gt;<div class="im">
<br>
&gt;Content-Type: text/plain; charset=&quot;iso-8859-1&quot;</div></div>
<p>&gt;Hi Adam,</p><div><div></div><div class="h5">
<p>&gt;I&#39;m stumped .. I guess you could try the following:</p>
<p>&gt;* Try with the trunk version of freeswitch.  I don&#39;t think it will matter,<br>&gt;but just in case</p>
<p>&gt;* Try to simulate the same test with a Lua script.  Do you see the same<br>&gt;problem?</p>
<p>&gt;If those don&#39;t turn up anything, then the next logical step would be<br>&gt;to start adding printf() statements in the mod_python code and<br>&gt;find out where it is getting stuck.  In particular around the parts where<br>

&gt;it swaps the threadstate in and out.  I might be able to create a patch<br>&gt;for you, but try those other tests first.</p>
<p>&gt;HTH,<br>&gt;Traun</p>
<p>&gt;</p>
<div>&gt;&gt;<br>&gt;&gt; Thanks for the response Traun.  The version of Python is 2.4.3, and I<br>&gt;&gt; didn&#39;t<br>&gt;&gt; build it myself, I installed it with yum.<br>&gt;&gt; The version of Red Hat is  4.1.2-41.<br>

&gt;&gt; &quot;import threading&quot; works fine, so I don&#39;t think it&#39;s a Python threading<br>&gt;&gt; issue.<br>&gt;&gt; The FreeSWITCH version I installed is the<br>&gt;&gt; freeswitch-1.0.3.tar.gz&lt;<br>&gt;&gt; <a href="http://files.freeswitch.org/freeswitch-1.0.3.tar.gz" target="_blank">http://files.freeswitch.org/freeswitch-1.0.3.tar.gz</a>&gt;<br>

&gt;&gt; located<br>&gt;&gt; at <a href="http://files.freeswitch.org" target="_blank">files.freeswitch.org</a>.<br>&gt;&gt; I didn&#39;t make any major changes to the configuration; I enabled Python and<br>&gt;&gt; set-up the SIP profile, directory and dialplan. No other changes.<br>

&gt;&gt; Any other help would be appreciated, since I really don&#39;t know where to<br>&gt;&gt; look.<br>&gt;&gt;<br>&gt;&gt; Thanks,<br>&gt;&gt; Adam</div>
<div> </div>
</div></div><br>_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>