Which scripting language should I use?

From FreeSWITCH Wiki
Jump to: navigation, search

The short answer: Lua.

The more in depth answer: Use what works for you, but be aware of the limitations.

JavaScript is very popular but that doesn't make it a great choice for embedded telephony programming. It is much heavier than Lua and it uses a completely different interface method to FreeSWITCH.

Python is very popular but that doesn't make it a great choice for embedded telephony programming. It does not embed nicely like Lua does. Furthermore, most of the FreeSWITCH developers are Perl fans. :)

Perl is still popular and it is a decent choice for embedded telephony programming. However, Lua is still lighter than Perl for this sort of thing and doesn't lack any features that Perl has, including regular expressions.

Bottom line: there's just no reason not to use Lua.

Performance?

It may matter, so let's compare:

Lua vs. Javascript: Script with MySQL database lookup, some simple logical decisions, creation of channel variables. For what it is worth, Lua was 50% faster than Javascript.