Introduction
This was a project for a client that wanted software that connected the front door of a block of flats to a concierge and individual apartments with a video link. The hardware belonged to the client but it could run a Java layer on top of the proprietary operating system. Unfortunately, I cannot give too much detail on the project but it was successful and the system was installed in the block of flats.
Comms
The hardware that this system ran on already supported various video and audio codecs. In the Java layer, all I had to do was initiate and close down each video/audio session. The protocol for doing this is called Session Initiation Protocol (SIP). It is an established protocol and is used by many different commercial products. One problem was that the system used a very old version of Java. There were very few libraries that I could use for any of the processing (for example, there weren’t even any standard string processing functions). In the end, I had to pretty much create a system that would handle SIP from scratch.
The Session Initiation Protocol has a pretty rigid specification for the bi-directional communication that needs to happen. The system had to handle connection to the concierge, redirects, hang ups from both sides, connection drops etc. So, it had to be pretty robust.
A diagram of a typical transaction during a Session Initiation Protocol is shown in the diagram below:
The structures for all the packets are completely defined within the specification. However, creating this and getting it working was quite a challenge. It involved many hours sat in front of the client’s hardware trying to packet sniff the comms (using an open hub, not a switch) to check that the packets were being formed correctly. It was almost impossible to live debug the hardware, so it was often a lot of trial and error. Also, because the comms software was running in a non-native layer, it wasn’t even easy to get debug information printed out. It was a bit like coding with your eyes closed.
Also, the client changed the specification half way through the project that required a small rewrite to add more features. Again, more difficult debugging. However, in the end it all worked.
Conclusion
I can’t really say too much more about this project but it was very interesting. I had done quite a bit of java but nothing with SIP, so it was definitely a challenge and a learning experience. In total it took a few months to complete but it was very satisfying.