Page tree
Skip to end of metadata
Go to start of metadata

About

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 _ESL.so file generated also (which must be kept in the same directory as the ESL.py).

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.

Recommended Installation

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

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/_ESL.so and libs/esl/ESL.py to a folder of your choosing.

See the "Pre-requisites" section at the ESL page for the libraries needed.

Install from PyPi

You can alternatively install a specific well tested version of this module from the Python Package Index.
The libesl code is directly from FreeSWITCH 1.4.18 and is packaged using setuptools native SWIG support.
It can be downloaded using pip:

Usage

The python module provides two classes: ESLconnection and ESLevent. They are documented generally (non-python specific) at the ESL page, in the "ESL Object" section.

You will want to first include the module:

You can then establish a connection using:

Examples