Have you ever thought about making a deep integration of OpenMeetings into your own site? Like making a registered user being able to conference with another one, if they are both reading the same site at the moment?
With the creation of instant communication server script pack you now can implement instant communication using OpenMeetings server on any of your CMS sites, or anywhere else. The technology is simple – you implement some of the JavaScript functions on the client side, such as client behavior in cases of being logged on and off, receiving a call(conference request), set some variables in scripts, such as server script location, OpenMeetings server location, set up a small database using our database creation script, and have fun.
Our script pack contains:
om_server.php – a php script that acts as instant communication server, processing logging on and off of your site's users, and establishing calls between them. After the call has been arranged, it creates a room on the OpenMeetings server scripted inside, and gives the unique links to that room to the users. Uses MySQL as a database for storing data.
openMeetingsAjaxClientLibrary.js – a JavaScript program that is responsible for all the client functionality with the above server, receives commands in the form of functions, and responds in callbacks.
masterSlaveDeterminator.js – a traffic optimization JavaScript program, that wraps the above JavaScript to decrease the traffic volume. Now, having several windows with the same page opened only one of them will work as a communication client, others will just pass commands and reaction from one to another.
jquery.cookies.2.1.0.js – this well-known cookies library was used to simplify the work of the JavaScript programs
uuid.js – library to implement GUID-like string constants generation
databaseCreationScript.sql – SQL database creation script for your MySQL database.
test_functionality.php, user.tmpl, invite.tmpl – a sample client code that uses the above functionality, implementation of the similar code on your web site will give you the instant communication functionality with OpenMeetings. Has two HTML/JavaScript templates, for entering the required user data, and a template for a user page with all the communication functionality. Override the user.tmpl file if you want to test your variant of interface code, then add the code to your page.
In order for everything to work, you need to have the following data scripted:
in om_server.php:
define("OM_ADMIN_LOGIN", OpenMeetings Admin Login );
define("OM_ADMIN_PASS", OpenMeetings Admin Password );
define("OM_SERVER_ADDRESS", OpenMeetings Server Address );
$link = mysql_connect(MySql server address - the one that has a database created with databaseCreationScript.sql , username, password );
in openMeetingsAjaxClientLibrary.js:
var server_address = URL with location of om_server.php
in client code (sample: user.tmpl):
sv_setserveraddress( URL with location ofom_server.php);
sv_setuserinfo( User ID, User display name );
As you see, by the time the client JavaScript code is displayed you should know which user is being shown, so please include this code into the page only if you know the user display name and his ID (any key, unique for each user). After everything has been scripted and you've made sure OpenMeetings server is up and running, you should only implement the reaction of the client code on different events, such as incoming call ( conferencing request ), reaction on your own call and such, all those method samples already exist in user.tmpl file, which you can study.
Here is the short description of every method you will need to override:
function my_onstatuschange(status) - Your online status has changed
function my_onmakecall( result ) - You have made a call, false result means user you called is offline
function my_onincomingcall( callerName, link ) - Incoming call from callerName, if you want to start conferencing, go to the link
function my_oncallanswered( calleeName, link ) - Your call to calleeName has been answered – you can go to the link
function my_oncallrejected( calleeName ) - Your call to calleeName has been rejected
function my_onstatusmessage(message) – You have a debug status message
function my_masterstatuschanged( masterStatus ) - Your page in browser has become a master. This means only code in this page works with the server, others reflect it(to save the traffic)
function my_clearincoming() - Clear information about last incoming call
function my_clearanswered() - Clear information about last answered call
function my_clearrejected() - Clear information about last rejected call