Moment API
Mometn VS supports external plugins written in C or C++. Plugins communicate with the server using a programming interface (API) described int moment/api.h header file.
Building and installing plugins
Plugins are built as shared libraries (.so). To install a plugin, put its .so file into /opt/moment/lib/moment-1.0 directory.
Plugin entry point is moment_module_init() function.
Sample plugin
An example of a plugin for Moment VS is "Video Phone" app module (see "Builtin applications" section).
Video Phone plugin works as follows. After a client enters conversation code, videophone flash module connects to the server and tells it the code. When another client with the same conversation code shows up, communication session is started.
Source code of the module can be found at https://github.com/erdizz/mychat
Files of interset:
mychat/mychat.cpp — plugin written in C++
web/MyChat.as — flash module (written in ActionScript)
web/index.tml — Video Phone web page with chat in JavaScript
Back to Contents