[Freeswitch-users] ESL python

Michael Jerris mike at jerris.com
Mon Oct 27 19:52:55 MSK 2014

Can't you just have a different connection managed by the other thread?  Does that work?

> On Oct 25, 2014, at 2:57 PM, Swapnil Ayachit <s.Ayachit at cataleya.com> wrote:
> Hello friends,
> I am new to Freeswitch. I like freeswitch architecture and its flexibility.
> I have couple of questions:
> Is the ESL connection objection thread safe?
> Can we post ESL events to a queue and handle it by a different thread and if this new thread can write back on the ESL connection
> Problem:
> I  am facing a problem with  a python program using outbound ESL interface which plays announcement, collect digits and bridges a call. First call always works but 2nd call  doesn’t work after playback command from app. eslLogLeve(7) and fs_cli doesn’t show any errors. 
> App:
> We have a server thread which accepts incoming connection from FS, answers call and waits for other events. If it receives CHANNEL_ANSWER or DTMF event then it post event along with connection object to python queue.   
> We have another thread which processes events from queue. It plays announcement for CHANNEL_ANSWER event and it stores digits for DTMF events. If digit lenth becomes 4 then it bridges call to a gateway.
> FreeSWITCH Version 1.2.24+git~20140513T183205Z~9af707ed20~64bit (git 9af707e 2014-05-13 18:32:05Z 64bit) on RedHat 6.4.
> Con is outbound ESL connection object
> Python:
>    while con.connected():
>       fs_event = con.recvEvent()
>       if name == "DTMF”:
>          eventQueue.put(conn, fs_event)
> server = SocketServer.ThreadingTCPServer(('', 8040), ESLRequestHandler)
> If I don’t put event in python queue and process it within while con.connected() loop then program always works but I would like to process event in other thread. 
> recvEventTimed(100)  or creating new inbound connection to execute FS commands couldn’t help.
> Appreciate any help.
> Regards,
> Swapnil
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services: 
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20141027/9a9e2c84/attachment.html 

Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list