VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
wiltingtree at gmail.com Guest
|
Posted: Wed Apr 08, 2009 10:33 am Post subject: [Freeswitch-users] Two or more simultaneous calls not |
|
|
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 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
Quote: | Date: Wed, 8 Apr 2009 06:36:27 +0430
From: Traun Leyden <tleyden@branchcut.com (tleyden@branchcut.com)>
Subject: Re: [Freeswitch-users] Two or more simultaneous calls not
working
To: freeswitch-users@lists.freeswitch.org (freeswitch-users@lists.freeswitch.org)
Message-ID:
<f9f80d540904071906j74c53d54q2c4acab117be10f4@mail.gmail.com (f9f80d540904071906j74c53d54q2c4acab117be10f4@mail.gmail.com)>
Content-Type: text/plain; charset="iso-8859-1"
Quote: |
Hello,
I wrote an application using FreeSWITCH version 1.0.3, with mod_python and
a
64 bit box on Red Hat.
The app works fine when one person dials in, but when a second person dials
in, the first call stops and waits until the second call is finished. It's
really strange - if the first call is right in the middle of playing a
prompt, it will just stop, and there will be dead air. As soon as the 2nd
call hangs up, the prompt for the first call starts playing right where it
left off.
I previously had FreeSWITCH installed on a 32 bit CentOS box, and this was
not happening.
Does anybody have any idea what the cause of this could be?
Thanks!
|
I'm running mod_python fine with 64-bit (Ubuntu and fs svn 12793, and
have not seen that problem. Which version of python? Did you build it
yourself or was it from a package? If its from a package, please provide
the version of Red Hat you are using.
One possible cause is that python was not compiled with multi-threading
support. I don't know how to check that however .. googled around and
didn't find anything. If you fire up
your python interpreter and type "import threading" do you get an error?
|
|
|
Back to top |
|
|
tleyden at branchcut.com Guest
|
Posted: Wed Apr 08, 2009 5:14 pm Post subject: [Freeswitch-users] Two or more simultaneous calls not |
|
|
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
Quote: |
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 |
|
|
Back to top |
|
|
wiltingtree at gmail.com Guest
|
Posted: Wed Apr 08, 2009 9:11 pm Post subject: [Freeswitch-users] Two or more simultaneous calls not |
|
|
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
Quote: | 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
Quote: | 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
|
| |
|
Back to top |
|
|
anthony.minessale at g... Guest
|
Posted: Thu Apr 09, 2009 8:41 am Post subject: [Freeswitch-users] Two or more simultaneous calls not |
|
|
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@gmail.com (wiltingtree@gmail.com)> wrote:
Quote: | 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
Quote: | Message: 8
Date: Thu, 9 Apr 2009 02:36:08 +0430
From: Traun Leyden <tleyden@branchcut.com (tleyden@branchcut.com)>
Subject: Re: [Freeswitch-users] Two or more simultaneous calls not
|
Quote: | 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
Quote: | 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@lists.freeswitch.org (Freeswitch-users@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@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400 |
|
Back to top |
|
|
tleyden at branchcut.com Guest
|
Posted: Fri Apr 10, 2009 12:47 am Post subject: [Freeswitch-users] Two or more simultaneous calls not |
|
|
Hey you beat me to it. I was going to have a look this morning but
had no internet because some asswipe cut a bunch of fiber optic cables
and took out phone/internet for a big part of the bay area.
I haven't tried your patch yet, but I see something that looks suspect:
http://fisheye.freeswitch.org/browse/FreeSWITCH/src/switch_cpp.cpp?r=12958
In playAndGetDigits() there are now two calls to begin_allow_threads()
(line 778 and 780) followed by only one call to end_allow_threads() (line 793)
Also I guess it would have better to test against JS, since it should have
had the same bug right? Lua just ignores the threadswapping stuff but
IIRC javascript uses it in much the same way as python. Or did I miss something?
|
|
Back to top |
|
|
mike at jerris.com Guest
|
Posted: Fri Apr 10, 2009 7:33 am Post subject: [Freeswitch-users] Two or more simultaneous calls not |
|
|
On Apr 10, 2009, at 1:35 AM, Traun Leyden wrote:
Quote: |
Hey you beat me to it. I was going to have a look this morning but
had no internet because some asswipe cut a bunch of fiber optic cables
and took out phone/internet for a big part of the bay area.
I haven't tried your patch yet, but I see something that looks suspect:
http://fisheye.freeswitch.org/browse/FreeSWITCH/src/switch_cpp.cpp?r=12958
In 11 months">playAndGetDigits() there are now two calls to 16 hours">begin_allow_threads()
(line 778 and 780) followed by only one call to end_allow_threads() (line 793)
Also I guess it would have better to test against JS, since it should have
had the same bug right? Lua just ignores the threadswapping stuff but
IIRC javascript uses it in much the same way as python. Or did I miss something?
| It's similar, but we don't use swig for javascript and we don't use switch_cpp so it would not have reproduced the issue.
MIke |
|
Back to top |
|
|
mike at jerris.com Guest
|
Posted: Fri Apr 10, 2009 7:36 am Post subject: [Freeswitch-users] Two or more simultaneous calls not |
|
|
On Apr 10, 2009, at 1:35 AM, Traun Leyden wrote:
Quote: |
Hey you beat me to it. I was going to have a look this morning but
had no internet because some asswipe cut a bunch of fiber optic cables
and took out phone/internet for a big part of the bay area.
I haven't tried your patch yet, but I see something that looks suspect:
http://fisheye.freeswitch.org/browse/FreeSWITCH/src/switch_cpp.cpp?r=12958
In 11 months">playAndGetDigits() there are now two calls to 16 hours">begin_allow_threads()
(line 778 and 780) followed by only one call to end_allow_threads() (line 793) |
Extra line removed, I did notice when looking in that file other methods that probably need begin/end, for example the blocking pop in event consumer. Would you mind going through the rest and seeing if their are other obvious misses?
Mike
Quote: | 16 hours">
Also I guess it would have better to test against JS, since it should have
had the same bug right? Lua just ignores the threadswapping stuff but
IIRC javascript uses it in much the same way as python. Or did I miss something?
|
|
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|