Skip to main content

ESL Example Clients

Some examples of Event Socket clients to inspire your own code.

Liverpie

Liverpie (language independent IVR proxy) is a free little piece of software, written in Ruby, that talks to FreeSWITCH on one side, and to any web application on the other, regardless of language, platform etc. It translates FreeSWITCH mod_socket dialogue into HTTP talk (embedding various parameters in HTTP headers), so you can write your own http-speaking finite state machine and hook it to FreeSWITCH via Liverpie. Note also that Liverpie expects the response in YAML so you can save yourself the pain of providing XML if you are comfortable with Liverpie doing the translation.

Find Liverpie here: www.liverpie.com

Telnet Client

telnet to port 8021 and enter "auth ClueCon" as password to authenticate. From here you can send any of the commands listed in this document. Note that you need to provide a double empty line after the command so it processed.

Ruby Libraries

Python Libraries

  • A Twisted based client and example can be found in the the scripts/python/freepy directory of the FreeSWITCH source code
  • eventsocket: an alternative twisted protocol which supports inbound and outbound methods + examples
  • PySWITCH: one more library for Python and Twisted programmers. It has extensive support for FreeSWITCH API, bgapi and Dialplan Tools.
  • greenswitch: This is an implementation of Event Socket Protocol using gevent greenlets. It is already in production and processing hundreds of calls per day.
  • switchio: asyncio powered cluster control which leverages modern Python's new native coroutines. Comes with a full-blown auto-dialer originally built for stress testing.

PHP Client

Website based PHP example PHP Event Socket

Another example in PHP : freeswitcheventsocketlistener

Java Client Libraries

Java_ESL describes several options for using Java to communicate with the ESL.

Javascript / Node.js library

.NET Client library

Support is included in tree for building under Windows. See libs/esl/managed managed_esl.201x.

There is a sample application included named ManagedEslTest. This will demonstrate how the start a simple inbound example as provided but also shows the other modes as well.

The managed portions are platform neutral but the esl swig wrapper (the ESL project in the managed solution) is platform dependent and must be built for the intended platform. You must also have previously built the main FreeSWITCH project as the native esl library is included from there otherwise you will receive a esl.lib not found error.

[1] AgbaraVOIP .NET Client

Go Client library (golang)

These Go libraries support both inbound and outbound event socket connections.