mod_v8 is built and installed by default as of revision b76233266931ca0b53f3bcc589277b972d714216.
If for some reason it's not, do the following:
- Uncomment languages/mod_v8 in modules.conf in your src directory (make it always build and install mod_v8)
- Run 'make mod_v8-install' to make and install just the v8 module
- Edit conf/autoload_configs/modules.conf.xml in your FreeSWITCH™ install directory to load mod_v8
- In fs_cli, run "load mod_v8"
For database support, the system must be configured to use ODBC. If it is, the built-in class for ODBC will automatically be built.
A difference between the old mod_spidermonkey and mod_v8 is that the basic extra modules (ODBC, CoreDB, Socket, etc.) are now compiled directly into mod_v8.
Execution of a script
From the Dialplan, you simply call it as an application similar to:
At the FreeSWITCH™ console, or some other application/interface execute the jsrun call with the script name as its argument.
Other Points Of Interest
Logs a message to the console logger.
console_log(message) console_log(level, message)
- You most likely want to add a \n to the end of your message, other than that its just a text string.
- In the single-argument form, the level defaults to "debug"
- Levels: "DEBUG", "INFO", "NOTICE", "WARNING", "ERR", "CRIT", "ALERT".
console_log("Hello there\n"); console_log("WARNING", "Ho!\n");