Python ESL

From FreeSWITCH Wiki
Jump to: navigation, search



The Python ESL module allows for native interaction with FreeSWITCH over the event socket interface. It allows for sending commands, receiving output and sending and receiving events and IVR interaction from the FreeSWITCH server. The Python ESL module is an auto-generated swig python module with a binary component to it. You CANNOT just copy the PM file and use that, you must properly compile the module and get the file generated also (which must be kept in the same directory as the Note any time a change to libesl occurs you will need to re-make and install the python ESL module or else things may break or work un-expectedly.


In the freeswitch source directory change to libs/esl and run:

make pymod
make pymod-install

This should install the ESL module into your python site-packages folder. If for some reason you want to manually install it or keep it locally you still must run the make pymod command to compile it but then can copy the libs/esl/ and libs/esl/ to a folder of your choosing.

The following libraries may be needed for things to work properly: TBD

CentOS - some dependencies



The python module provides two classes ESLconnection and ESLevent they are documented generally (non-python specific) at:


You will want to first include the module:

import ESL;

You can then establish a connection using:

con = ESL.ESLconnection("", "8021", "ClueCon");




There are examples in libs/esl/python

  • - subscribe to all events and print them to stdout
  • - TBD
  • - execute a single command over ESL