Wednesday, March 24. 2010
Integrating Skype into a Portal


Some time ago I thought I was going to be involved in a intranet portal development. The portal had a lot of different parts but the most complicated one was, at first sight, a instant messaging integration with chat, voice and video requirements. The whole project needed be done with open source (customer meant to say free) solutions and selected VoIP client had to be multi-platform (at least windows, mac and linux). Although finally I was not involved a little investigation was performed and... What better place to summarize it than here!
The topic of this entry is web/portal instant messaging integration. So client software, sound or image quality, sip or jingle protocol, codecs or any other technical features of the VoIP solution are not taken into account. Following these factors the main question is: What does a portal need from the instant messaging software? I decided to search the answer looking what a enterprise quality solution gives. And who implements a good, tested, spread VoIP solution...
Skype was my reference.
A typical whitepages portlet needs to know the status of the user in the messaging solution (online, offline, eager to chat, do not disturb me or whatever) for showing it.
Skype mystatus.skype.com site lets anybody to share his status (online status needs a privacy option to be set in Skype client application). Service complete reference is available in a pdf provided by Skype but a quick summary is the following:
The whitepages portlet needs to interact with the VoIP userspace client application. Operations directly clicked from the browser have to be available in any portal solution: start a chat, a call, request authorization, etc. This way, when a work mate was found and displayed in the whitepages portlet we can, first, know his status (presence), and second, start a conversation or request/add him as our contact.
Skype uses for this purpose its own uri protocol. The complete detail for this little protocol is again in Skype developer site but its basics are very very simple:
Finally a little whitepages portlet is presented. It was deployed on a liferay 5.2 java portal running on tomcat 6 application server. The portlet accesses mystatus skype site using HTTP from the server side (web service like solution) and depending user status the rest of the options (chat, call,... ) are shown or hidden. The following video shows how I search myself in the portlet and start a call, from my brother skype account of course.

Long Live Rock 'n' Roll!
PS: A second entry about this topic is on schedule. An open source based VoIP solution will be used behind my little whitepages portlet.
The topic of this entry is web/portal instant messaging integration. So client software, sound or image quality, sip or jingle protocol, codecs or any other technical features of the VoIP solution are not taken into account. Following these factors the main question is: What does a portal need from the instant messaging software? I decided to search the answer looking what a enterprise quality solution gives. And who implements a good, tested, spread VoIP solution...
Skype was my reference.
Presence
A typical whitepages portlet needs to know the status of the user in the messaging solution (online, offline, eager to chat, do not disturb me or whatever) for showing it.
Skype mystatus.skype.com site lets anybody to share his status (online status needs a privacy option to be set in Skype client application). Service complete reference is available in a pdf provided by Skype but a quick summary is the following:
- http://mystatus.skype.com/skypename.txt gives the txt status representation of a user. For example, if I am online and http://mystatus.skype.com/rickyepoderi.txt is set in a browser, online is returned in plain text (text/plain mime).
http://mystatus.skype.com/balloon/skypename returns a image with a balloon that says the user status (image/png mime). Using my skype user when online it returns the image at the right. So the easiest way to integrate skype presence service is adding a img link in a final html page as follows:
<img alt="Skype Status" src="http://mystatus.skype.com/balloon/skypename"/>
Browser interaction to VoIP client
The whitepages portlet needs to interact with the VoIP userspace client application. Operations directly clicked from the browser have to be available in any portal solution: start a chat, a call, request authorization, etc. This way, when a work mate was found and displayed in the whitepages portlet we can, first, know his status (presence), and second, start a conversation or request/add him as our contact.
Skype uses for this purpose its own uri protocol. The complete detail for this little protocol is again in Skype developer site but its basics are very very simple:
- skype:skypename?chat: Start a chat to this contact.
- skype:skypename?call: Start a call to this contact.
- skype:skypename?add: Add skypename to contact list; show authorization dialog.
- Add skype debian repository to your /etc/apt/sources.list adding the line:
deb http://download.skype.com/linux/repos/debian/ stable non-free
- Install skype and some python/skype functionality packages:
$ sudo apt-get install skype python-skype skysentials
- Download the python script that handles skype uris for your browser action_handler_1.0.py from philipp's page.
- Make firefox (iceweasel) to handle skype protocol using the script downloaded in the previous step. Although there are a lot pages that explain this point (Skype blogs, mozilla wiki and third party pages) no one worked for me and I modified mimeTypes.rdf file directly (this file is located under firefox profile directory, in iceweasel something like ~/.mozilla/firefox/XXXXXXX.default/mimeTypes.rdf). A diff between backup and modified file shows the following differences:
$ diff mimeTypes.rdf mimeTypes.rdf.bck
18d17
< <RDF:li RDF:resource="urn:scheme:skype"/>
60,62d58
< <RDF:Description RDF:about="urn:scheme:externalApplication:skype"
< NC:prettyName="skype"
< NC:path="/home/ricky/apps/action_handler_1.0.py" />
152,155d147
< <RDF:Description RDF:about="urn:scheme:skype"
< NC:value="skype">
< <NC:handlerProp RDF:resource="urn:scheme:handler:skype"/>
< </RDF:Description>
162,165d153
< <RDF:Description RDF:about="urn:scheme:handler:skype"
< NC:alwaysAsk="false">
< <NC:externalApplication RDF:resource="urn:scheme:externalApplication:skype"/>
< </RDF:Description>
Finally a little whitepages portlet is presented. It was deployed on a liferay 5.2 java portal running on tomcat 6 application server. The portlet accesses mystatus skype site using HTTP from the server side (web service like solution) and depending user status the rest of the options (chat, call,... ) are shown or hidden. The following video shows how I search myself in the portlet and start a call, from my brother skype account of course.


Long Live Rock 'n' Roll!
PS: A second entry about this topic is on schedule. An open source based VoIP solution will be used behind my little whitepages portlet.
Comments