Using OpenMeetings as instant communication server.



Introduction

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.

Instant communication server script pack contents



Required steps to make everything work

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