In FreeSWITCH, there are many ways to use Perl, not all of which require the mod_perl module or the CPAN Perl modules. You can use Perl in the following ways with FreeSWITCH:
- Executing Perl scripts via curl, etc. to return XML configuration (only requires the curl module)
- Socket control / event socket interaction (send and receive events, execute commands, and IVR over socket interaction) through Perl ESL; this does not require mod_perl, only the Perl ESL module.
- Application action / standard execution to carry out a dialplan (requires mod_perl)
- Native XML generation (requires mod_perl)
If you want or need the advanced control that mod_perl provides please see the mod_perl page for the full documentation on it.
There is no one way to install Perl support. As outlined above you can use Perl many different ways, each having different requirements. See the mod_perl page for building mod_perl.
Execution of a script
You can run scripts directly from the console with:
If you just want to run a perl script (or any normal application) from a dialplan, invoke the system app:
<action application="system" data="/path/to/app.pl"/>
Note: FreeSWITCH™ has a "scripts" directory which can be determined from the console via the command:
You must specify either
or the full absolute path to your script when you invoke it from the dialplan.
- mod_perl examples on mod_perl page.
- Github — search the freeswitch-contrib tree of the repository for *.pl for numerous examples of perl scripts running against FreeSWITCH