[Freeswitch-users] Two or more simultaneous calls not

Anthony Minessale anthony.minessale at gmail.com
Thu Apr 9 06:15:38 PDT 2009


easier than you think,

Just like Traun had suspected, the methods in the C++ wrapper for the read
app was missing the begin and end allow threads calls
that are only important to python to tell it to suspend the thread state
while FS specific code is being executed.

2 line fix in trunk rev 12958

On Wed, Apr 8, 2009 at 8:59 PM, Adam Wilt <wiltingtree at gmail.com> wrote:

> Traun, thanks again for your help.
> I followed your advice and I made some progress!
>
> I tested with the latest trunk version and also with 1.0.2, and both
> exhibited the same behavior.
> I then tried writing a test script in Lua, and it worked fine.
> So this meant the problem was in the Python module (I was sure it was some
> FS config issue).
> So I started playing with a small test Python script, and I narrowed the
> problem down to when I'm using the "read" function.
> Here is my test script:
>
> from freeswitch import *
> def handler(session, args):
>   #answer the call
>   session.answer();
>   #play a file
>   session.streamFile("long_prompt.mp3")
>   # Test 1 - FAILED!
>   digits = session.read(5, 10, "long_prompt.mp3", 3000, "#")
>   # Test 2 - WORKED OK!
>   #session.getDigits(1,"#",7000)
>   #session.streamFile("long_prompt.mp3")
>   # TEST 3 - WORKED OK!
>   #digits = session.playAndGetDigits(5, 10, 1, 60, "#","long_prompt.mp3",
> "", "")
>   #hangup
>   session.hangup();
> 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.
>
> Then I re-comment test 1 and uncomment either test 2 or test 3, Both
> prompts play just fine for both channels.
>
> So I think there may be a bug in the read() function somewhere.  I took a
> look at it, but it's way over my head.
>
> Thanks again,
> Adam
>
>
>
> >Message: 8
> >Date: Thu, 9 Apr 2009 02:36:08 +0430
> >From: Traun Leyden <tleyden at branchcut.com>
> >Subject: Re: [Freeswitch-users] Two or more simultaneous calls not
> >To: freeswitch-users at lists.freeswitch.org
> >Message-ID:
> >       <f9f80d540904081506p3f0647fei4cf843d0b1904bc0 at mail.gmail.com>
> >Content-Type: text/plain; charset="iso-8859-1"
>
> >Hi Adam,
>
> >I'm stumped .. I guess you could try the following:
>
> >* Try with the trunk version of freeswitch.  I don't think it will matter,
> >but just in case
>
> >* Try to simulate the same test with a Lua script.  Do you see the same
> >problem?
>
> >If those don't turn up anything, then the next logical step would be
> >to start adding printf() statements in the mod_python code and
> >find out where it is getting stuck.  In particular around the parts where
> >it swaps the threadstate in and out.  I might be able to create a patch
> >for you, but try those other tests first.
>
> >HTH,
> >Traun
>
> >
> >>
> >> Thanks for the response Traun.  The version of Python is 2.4.3, and I
> >> didn't
> >> build it myself, I installed it with yum.
> >> The version of Red Hat is  4.1.2-41.
> >> "import threading" works fine, so I don't think it's a Python threading
> >> issue.
> >> The FreeSWITCH version I installed is the
> >> freeswitch-1.0.3.tar.gz<
> >> http://files.freeswitch.org/freeswitch-1.0.3.tar.gz>
> >> located
> >> at files.freeswitch.org.
> >> I didn't make any major changes to the configuration; I enabled Python
> and
> >> set-up the SIP profile, directory and dialplan. No other changes.
> >> Any other help would be appreciated, since I really don't know where to
> >> look.
> >>
> >> Thanks,
> >> Adam
>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090409/014c661b/attachment-0002.html 


More information about the FreeSWITCH-users mailing list