[Freeswitch-users] Two or more simultaneous calls not

Adam Wilt wiltingtree at gmail.com
Wed Apr 8 18:59:46 PDT 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090408/aa0f15c8/attachment-0002.html 


More information about the FreeSWITCH-users mailing list