Re: [Freeswitch-users] Event socket and Python
Sami Montour wrote:
Hi, Freeswitch is listening on port 8021 not 8041. Just tried the script below and works fine on my machine. Running python 2.7.3 and FS 1.2.12
Right, the point of connecting to port 8041 was to connect to a closed port. For me, this test shows that con.connected is True even when there is no connection. If you run the python code in my first message (http://permalink.gmane.org/gmane.comp.telephony.freeswitch.user/64360), what does that print?
Sorry I misunderstood your post about testing with a closed port. Anyway, I ran your script (port 8041) but didn't get a connection to FS, different from what you received. I added an "else" statement to illustrate this point and received "Not connected". I guess this is the expected behavior.
python ib_esl.py Not connected!
Here is the script I ran. ================================================ import ESL # Establish an inbound connection to FreeSWITCH con = ESL.ESLconnection("localhost","8041","ClueCon") # set event command to receive all events con.events("plain", "all"); if con.connected(): print "Connected successfully!" e = con.recvEvent() if e: print "Event: ", e.serialize() else: print "Not connected!" ================================================ -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Johan Brannlund Sent: Friday, September 06, 2013 4:43 PM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] Event socket and Python Sami Montour wrote:
Hi, Freeswitch is listening on port 8021 not 8041. Just tried the script below and works fine on my machine. Running python 2.7.3 and FS 1.2.12
Right, the point of connecting to port 8041 was to connect to a closed port. For me, this test shows that con.connected is True even when there is no connection. If you run the python code in my first message (http://permalink.gmane.org/gmane.comp.telephony.freeswitch.user/64360), what does that print? _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list 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
participants (2)
-
Johan Brannlund
-
Sami Montour