问题
Many languages are embedded into FreeSWITCH (such as JavaScript, see the docs), made possible by SWIG "to make the core FreeSWITCH library accessible to scripting".
Languages can also use the Event Socket Library for the same purpose, so what is the difference?
回答1:
As the FreeSWITCH 1.2 book points out, they are indeed not the same:
ESL scripts versus built-in languages
Keep in mind that ESL-based programs are not the same as using built-in languages. The FreeSWITCH event socket is a TCP-based connection to FreeSWITCH. The ESL is an abstraction library that is available for more languages than just the few that are built-in to FreeSWITCH. You must first install the Lua, Perl, Python, or PHP for your system before using ESL.
Built-in languages ship with a FreeSWITCH installation by default, and they can be used to write scripts to control (and configure1) a FreeSWITCH instance instead of editing the XML files to achieve the same. These scripts can only be called either from a dialplan action or form the console as an API call (e.g., look for luarun or jsrun).
Scripts using the Event Socket Library (ESL) can be run from anywhere achieving the same results as built-in languages, but first they establish a network connection to the FreeSWITCH instance to be able to send API calls.
1 See Serving Configuration with mod_lua and Serving Configuration with JavaScript documentation pages.
来源:https://stackoverflow.com/questions/59228325/what-is-the-difference-between-built-in-or-embedded-languages-in-freeswitch-an