Bridging SIP Servlets and JAIN SIP

As discussed in one of my earlier blogs, there are 2 SIP stacks that can be used to build SIP applications - SIP Servlet API and JAIN SIP API. Both have their advantages and disadvantages. For example, JAIN SIP API provides more structured way of building SIP Applications and could be used for any of the SIP entities. But SIP Servlet is more suitable for server side SIP entities; saying this SIP Servlet has the advantage of leveraging enterprise services more directly as it is integrated with Java EE containers.
As I am planning to develop a VVoIP framework I would like to leverage strength of both. So I have decided to develop a bridge (or more appropriately adapter) between the APIs and that initiative have resulted JAIN SIP API Adapter project. The project's aim is to let JAIN SIP API based Server side applications benefit from JAVA EE Services by using SIP Servlet API. I hope to complete this project in 3 months to come and release a beta version. Initially the system will be tested on SailFin with a IM server I developed based on JAIN SIP API.

Video Recording using Flash

Recording Video using Flash is a trend on the high. YouTube Quick Capture is one that has caught our eyes on this. So I was trying to get something done in the same way. I am basically Java developer and have experience of developing Video Recorder using Java Media Framework. Though I am a Java fanatic I feel that at present Flash is the way to Video on Internet. Its adaptation in video technology is very wide spread and well acclaimed. This blog is about is about video recording.

The first thing that is required for Flash video recording is a media server for streaming; because Flash unlike signed applet can store on local disk, it in fact streams the captured video to media server. There is Adobe Media Server or Flash Communication Server that we can use after procuring or there is Red5; thanks to the open source community. Now with Red5 comes a sample simple video recorder, using which you can simply stream video to the server. If we look at a customized Simple Recorder (it is only the recorder and there is no attached streaming server :) if anyone can help please let me know) we will find that for sole recording purpose there is a video container that shows the video. Initially it shows the currently being captured video and once the recording is stopped it shows the streamed video of the just recorded stream. This events are triggered by the buttons on SWF video. It uses the oflaDemo Red5 Application provided as demo with the server. All streamed videos are stored in {RED5_HOME}/webapps/oflaDemo/streams/.

Now lets look at the code used for this purpose. The first task is to open an stream when we intend to record something.
var nc:NetConnection = new NetConnection();

// connect to the local media server
// rtmp://{host}:{port}/{Red5_application_context}
// default port is 1935

// create the netStream object and pass the netConnection object in the
// constructor
var ns:NetStream = new NetStream(nc);
The second thing that we can do is detect and select the capture devices.
// get references to the camera and mic
var cam:Camera = Camera.get();
var mic:Microphone = Microphone.get();
Now above we selected the default devices but we could Camera.names to get the names of the capture devices and select the one that we want; this is something that YouTube does :). Next we need to configure the video capture stream.
// setting dimensions and framerate
cam.setMode(320, 240, 30);
// set to minimum of 70% quality
//Setting sampling rate to 8kHz
Next we need to add the device streams to the capture stream.
// This FLV is recorded to webapps/oflaDemo/streams/ directory
// attach cam and mic to the NetStream Object
After that we need to add the camera to the container and publish the video.
// attach the cam to the videoContainer on stage so we can see ourselves
// Publish the video and mention record
// lastVideoName is the name of the video and it will be saved as ]
// lastVideoName.flv
ns.publish(lastVideoName, "record");
Now once the recording is just clear the video container and the captured stream to the container and specify the stream to play the just recorded video
// attach the netStream object to the video object
// play back the recorded stream;
Hopefully with these steps a video recording and stream playback should be possible.

Stickies on Ubuntu

It seems that Wine is an excellent tool to run Windows application on Ubuntu. Recently I had to use Stickies and tried it on Ubuntu. So first I had to install Ubuntu. I executed the following commands to install Wine on Ubuntu 7.04 Fiesty.
sudo wget -O /etc/apt/sources.list.d/winehq.list

sudo apt-get update

sudo apt-get install wine
For other platforms you can have a look at Then you have to simply download the stickies.exe and then execute
wine {PATH-TO-STICKIES}/stickies.exe
But hold on the installation is not done, you need get the following the installation steps mentioned in

scroll down to Install Note and follow that. The only change will be installing the MSI file, instead of the one mentioned there use the following to install the MSI file
wine msiexec /i/{PATH-TO-MSI}MSISetup.MSI

Now try to execute
wine /.wine/{PATH-TO-STICKIES-INSTALLATION}/stickies.exe

It might say that MFC42.dll is missing, if it says so please get it from a Windows installation and copy it to /.wine/drive_c/windows/system32/ and try to execute it again.

Hopefully that will be enough for Stickies Installation :).
Now to get the Stickies running you can execute the following command:
sudo wine ~/.wine/drive_c/Program\ Files/stickies/stickies.exe > {PATH-TO-LOG}
2>&1 &
Though this is for Ubuntu but I guess excepting the installation procedure rest should be same across Linux platform. Let me know if any further changes were required.