[Freeswitch-users] ESL python

Swapnil Ayachit s.Ayachit at cataleya.com
Sat Oct 25 22:57:22 MSD 2014


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

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


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