FINAL REPORT
Group 4 - Phonetics
Team 2 - Signaling
12/18/98
Madhav Ranjan
Abhideep Singh
Project Description
Q1) What did you set out to do? Use a figure and accompanying text to describe what you set out to do. You can reuse part of your first report if you wish. You should have sufficient detail so that someone who is not familiar with the project would still be able to understand the scope of your work. For instance, imagine giving this to a friend who is not in the class--write something that this person would be able to understand without having to ask you for help.
Signaling is the basic functionality in the control plane. It allows voice calls to be set up in the Internet and the telephone network, and the Gateway to associate telephone numbers with IP addresses and vice versa. Our goal as the Signaling team was to provide functionality to all the applications and ensure that all aspects of the control plane are hidden from the applications. Since almost all the teams in the group use Signaling, the project was extremely challenging in terms of coordination among teams. The project also allowed us to learn new technologies like JTAPI, SIP, Java Socket Programming etc. The first time we made a phone ring using JTAPI was a phenomenal experience!
We as the Signaling team set out to provide the following functionality:
These were the salient features that we were expected to provide according to the project description. Since we had considerable freedom in designing the interfaces and implementing the designs, the exact sequence of events is slightly different from that of the project description. The end result is, of course, the same – Internet Telephony! After reading the outline of what we actually accomplished the sequence of events will be clear. Two figures, illustrate the Dial and Handle Incoming Call sequences of our implementation. They follow on the next two pages.
Accomplishments
Q2) What did you actually accomplish? Write down exactly what you managed to get done by the time of the demo. Did you achieve all the goals you set out to do? Did you do something that you didn't expect to be doing when you started?
Overview
When we started this project, we knew little about socket programming. So we knew the final project would be extremely challenging and interesting. Since signaling was to deal with almost all the teams, we wanted to provide an interface as soon as possible and begin the integration process.
Our signaling model consists of the following classes. We have a DesktopSignaling java file that compiles with all applications that require signaling features. The applications can call functions like Dial and Hangup using DesktopSignaling as if they are part of a library. Now, the DesktopSignaling communicates with a UpperMascLayer server which is the main Signaling server listening for requests. "MASC" stands for MAin Signaling Component. The UpperMascLayer has a handle on the Masc class file that contains all the logic, including the Jtapi functionality. The Jtapi functionality is provided by a java class called JtapiHandler. When an instance of this class is created, the program gets a handle on the provider or the PBX and is ready to make calls. There is also a Dialer class that extends the java.lang.Thread class and contains the makeCall() and Hangup() functions. Since dialing takes a considerable amount of time this functionality is provided on a separate thread so that signaling can handle other requests. Since there are four lines available, we can make 4 outgoing calls at any given instance, all running on separate threads. It is, of course, possible for one or more lines to be in use for an incoming call. If all lines are busy then the PC application gets a SignalPacket that contains a BUSY flag. SignalPacket is a data structure that contains information about the source and destination. The most important varibale in the SignalPacket is the boolean SignalFlag that all the applications refer to, in order to find out the result of their function call. Public methods are provided to all applications to access the information contained in SignalPackets.
Specific Features Supported
During the development phase we learned new technologies like JTAPI, SIP and Java Socket programming. At present we have completed the integration process with all the teams. We have also completed all the goals that we had set for ourselves. The features we support include:
All applications call a signaling hang-up function that clears lines and informs applications. If a telephone line is hung up we inform the application associated with the line about the termination.
DesktopSignaling ds = new DesktopSignaling("1");//"1" is the application ID
SignalPacket sp = new SignalPacket();
sp = ds.Dial("src@phonetics.com", "dest@phonetics.com", "1");
When the function returns, sp contains all the information necessary to use Data Exchange to start the call provided the SignalFlag in sp, is not BUSY or REJECT.
Essentially, the DesktopSignaling class sends a UDP packet to the UpperMascLayer which decodes the packet, calls the corresponding method on MASC, encodes a packet containing the result and sends it back via TCP back to the DesktopSignaling component which is waiting for a response. The DesktopSignaling class then decodes the result (an object that is cast appropriately) and returns the value to the caller.
We interact with the Gateway to get a line to use for dialing. If a telephone hangs up we are informed by Gateway and we inform the respective application(s). We also inform Gateway if an application hangs up so that the line can be freed for incoming or outgoing calls. We also maintain information about the lines in use so that if all are busy then we can return a BUSY signal to the application, without querying the Gateway.
We essentially achieved much more than we expected. Working on this project was great fun and an exceptional learning experience. This may be the reason we worked harder to get all features incorporated into the project. We could use some more work on race conditions and errors. For that we need extensive testing to find small errors and how to handle them.
We also ended up interacting much more and helping in the design of other team’s applications. This was a pleasant surprise as it allowed us to work in a real world team situation. We organized meetings, discussed interfaces and figured out the best way to implement a feature and made sure it was feasible for all teams. Overall this has been the best project we have worked on in school and during our internships.
Problems and Lessons
3. Problems: It is possible that you did not actually accomplish what you set out to do :-( If so, why? What problems did you run into? Include both technical problems, and problems in coordinating your work with others. Be as specific as you can about technical problems. This is the only way we have to determine whether you really tried to solve the problem, instead of just giving up with token effort.
Internet telephony is new and exciting field and this posses great challenges in development of a system around this technology. Research and fair deal of brainstorming helped us overcome these problems. Over the course of the semester we realized that issue like learning about new technologies are simpler that solving problems that arise during the design phase and integration phase of a large project (Or perhaps we feel this was at this point of time). Most problems are a result of not only technical issues but have fair share coordinating problems associated with it. Here are some of the problems that we encountered over the course of the semester.
Integration Problems: It often seen during the course of developing the project that although different parts of code might work independently, new complication always arise during the integration of different components. It was true that different components might work in independent testing but create while interacting with other components of the Project. We once had a problem with passing of data from on component to another due to the very nature of the structure of the system. The Gateway was sending up a char (since there were only 4 lines) representing the line numbers that was free to make the call. Now while in C it is OK to pass a char off as a byte if you are trying to send a char, Java finds a problem with this. So while Gateway was pretty sure that it was sending us the right data, we never got the right data from them (And there certainly couldn't be packet corruption everytime). Problems such as these are difficult to pin point in a big project and make the job of integration extremely challenging. This is particularly true for Signaling because of the need to interact we all the application and all other components.
Preventing Layering Violations: In a big project, the line between application and control plane is often fuzzy. We tried to strictly enforce a system that avoids the layering violation. In the beginning itself, we sat down with every team to discuss their needs and explain to them what signaling can and cannot provide them. As people started working on their different components it was often seen that they went ahead and implemented the some aspects of the control plane itself, As soon as such a situation was discovered, we rectified the situation in conjunction with the application team. For example, it may seem that the management team needed to interact with very team to capture the current state of the network. It seems natural to expect that they implement way to find out state of the system by contacting every required component. On the other hand, the state of the system is changed ONLY by signaling. If signaling was to inform Management of every change that happens in the system, they can build the state of the system from the state-change transaction without continuously interacting with every component.
New Technologies: A big challenge we faced was working with JTAPI and finding out how we can provide certain functionality with JTAPI. Since Internet telephony is still quite a young technology, there are not many sample snippets of code other than the ones already posted. This problem was over come with a two-fold strategy. Firstly we did a lot of research on Internet telephony on sites like Lucent and IBM. The second was basically a lot of experimentation with the current code base we had accessed. A lot of functionality that we had to provide and the proper use of JTAPI was discovered by an exhaustive process of debugging. The course staff, especially Donna have been really helpful in this entire process. We have definitely learned a lot!
Interface Change and Availability Problems: Since signaling interacts with almost all the teams, we were careful to define methods that were providing full functionality to all the teams. Due to this reason we have spent considerable time to ensure that we reuse code as much as possible and avoid redundancy at all costs. The same sort of cooperation was also displayed by a majority of our group members. But as the project progresses, specs change and this involved changes both in our code as well as interfaces other people provided us. Coming up with changes such that it provides the added functionality, keeps in mind possible future needs as yet minimizes the work to be done is a great learning experience. It reinforces the concept of first coming up with a pseudo code of paper and then sitting down to solving problems.
Another big problem was the non-availability of some the interfaces required by signaling to start on a rigorous process of testing. Some of the teams did not provide us with their interfaces in time and thus were unable to provide them with control function that helped them integrate with the system. The signaling component is incomplete until everyone finished their code and has tested out their components using the control plane provided.
Testing - Robustness, Race Conditions etc: Since signaling provides the only component that provides the control, it reserves the exclusive right to change the state of the system. Thus it is imperative that signaling be continuously up and running to cater to the needs of a constantly changing system environment. Thus a rigorous set of tests was undertaken while testing the robustness of program. We made sure that even while designing the component we catch every freak exception that could result. The possible causes of crash of both signaling and other components were carefully explored an implemented. During the integration process, the behavior of the signaling had to be altered to make sure that Voicemail doesn’t crash or hang-up if it is in the middle of an operation that involves signaling. The same holds for other applications whose behavior and future actions were dependent on calls made to signaling (which was almost all apps). Lets say if we an app wants to make a call - a number of situation like failure of Directory service, or non-availability of gateway or even loss of packets can result in signaling to crash or wait indefinitely. A process of error check, timeout and retries made sure that the behavior of components like Directory Service etc doesn’t result in the crashing of the clients. Signaling made sure that the level of abstraction was maintained and the system was always operational no matter what happens to individual components.
Conflict between various Components: A components such as signaling faces problems of making sure that their code works properly with other components and the flow of information between components is fully functional. But it also bears the burden of acting as a means of communicating between various components. So if A is using Signaling to talk to B, we need to not only deal with incompatibilities with A or B, but also incompatibilities that might exist between A and B. The addition of more components complicates issue further and makes debugging a real challenge. It is extremely difficult to trace out which component is the one responsible for a certain problem. And in fact we found that, more often than not, problems are a result of multiple errors distributed evenly among the various components. The slow process of discovering these errors was interesting and gave an opportunity to understand everyone's code.
Learning
4. What you learnt: What did you learn by working on the project? Include details on technical things you learnt, as well as what you learnt about dealing with large projects, collaborating with other busy people, and dealing with other coursework.
Technical Learning
The most exciting aspect of the project is learning new technologies like JTAPI, SIP and RMI. One thing we realized is that Internet Telephony project is extremely challenging. There are various companies that are beginning to invest in this area and believe in its potential. Being a technology in its infancy it also has various undefined boundaries which with both its pluses and its limitations. Working with these limitations has been a really educational experience.
Design and Coordination of Big Projects
Since signaling deals with most of the team members, we had a great opportunity to be closely involved in the designing of the system as whole. Even though the interfaces and project descriptions were quite detailed, we also got a chance to work on the design of the project. It was a great learning experience and we have learnt a lot from each other. We learnt how to coordinate effectively and produce results in as short a time span as possible. It is easy to waste time and keep arguing about the best way to go about doing something. The hard part, we learnt, is to brainstorm and come up with the best solution. We believe in teamwork and that the best results are produced by good groups and individual’s hard work and dedication. We also learnt that sometime things don’t go as expected and overcoming these problems as a team can be a great feeling. These problems also made us realize that in life sometimes it is more important to come up with something that works rather than something that is the most efficient.
Scope for Improvement
5. What would you do differently next time: Everyone makes mistakes. But good learners don't repeat mistakes, they make all new ones! This project gave you a lot of freedom to make mistakes. What will you look out for the next time you undertake a large collaborative project?
More Brainstorming sessions: The brainstorming sessions that we had as a team proved to be extremely effective. They not only help come up with great solutions but also give an insight into the progress of a team as a whole. It give an opportunity to develop friendly relationships with other team members, which is a great asset in the smooth functioning of the team. If we had to do this all over again, we would plan a lot more of these sessions earlier in the semester.
Correctly Estimating Time Commitment: This project is a very ambitious one and requires a lot of time. It would be ideal to do this project with very little to no other work. That is, however, not possible in a college environment. We feel better time management and more time for the project, is something we definitely need to concentrate on. Given another chance for the first month we would do more testing and try to speed up the design process. As we mentioned earlier, it is better to lay out a detailed design than to work with a sketchy one and change a lot of code at a later time.
Start Integration Early: Although signaling is not really complete till every other component is fully functional, the process of integration can start pretty early on. We realized this slightly late in the semester that even the most basic of code can be integrated and should be integrated early on. This greatly removes the complexity of integration when the different components are huge and cumbersome.
Interfaces
6. Interface that your team will provide to other teams or use: Please give the exact procedure calls that you will make or support. This is your final interface spec. C/C++/Java code is OK.
Interfaces That We Use
TEAM 1 - Telephone Application
TEAM 3 - GATEWAY
TEAM 4 - DIRECTORY SERVICE
// Methods to obtain numbers, emails and IP addresses
// Listing features
// Conferencing support functions
TEAM 5 - ACCOUNTING & BILLING
//Tells billing all they need to know via various flags
TEAM 6 - MANAGEMENT & INTEGRATION
//Tells Management what we did via a String. The Strings are buffered up at the client-side server running on a separate thread and queried by Management off and on.
TEAM 7 - VOICE MAIL
TEAM 8 – CONFERENCE
Note: We had all the logic to support Conferencing in our code. The team, however, was working on their native application code till the last moment, hence we were unable to demonstrate that during the various demos. Given a couple of hours Signaling have the functionality to support Multi-Party Conferencing.
Interface That We Provide
Please note that we might add more functions to this list if applications realize that they need more functions. Once conferencing is incorporated into our logic we might have to provide more methods for that team. We also have two private methods that register DesktopSignaling Components with the MASC upon instantiation. This way we have a list of all active signaling components. There is an unRegister() method that removes a component as well. All other methods are private methods for parsing and providing low level support.
LIST OF METHODS
//Main function Applications use to Dial, a computer, Voice Mail or Telephone
//Dial also contains the logic to join callers to Conferences.
public SignalPacket Dial(String source, String destination, String yourID){
//Terminates calls
public boolean Hangup(String source, String destination, String line, String yourID){
//Gateway uses this to tell us that a telephone has hung up
public boolean gateHangup(String number, String line){
//check is a computer application is active and tell Gateway or Data Transfer
public boolean isActive(String address){
//check is two computers are active and tell Gateway or Data Transfer
public boolean isActive(String source, String destination){
//Hang up a call for voice mail
public boolean vMailHangup(String destIP, String port, String lineNo){
//gateway uses this to check for the validity of an extension entered
public SignalPacket isValid(String number){//1 it is active; 0 it is inactive
//Gateway tells us that a call is coming in, handle it.
public int handleIncomingCall(String number, int line)
//Management uses this to tell us to kill a connection
public boolean killConn(String user)
Course Staff
7. Advice for the course staff: What mistakes did we make in running this project? Please help us improve the course.
You all did a super job!!! Very approachable and always ready to help, we would never have been able to do this project, if it was not for your help and guidance. The staff was very knowledgeable about most of the issues and the requirements set for us. They were also willing to learn with us on issue that they were unsure of and were extremely good about getting back to us promptly.
Regarding the availability of resources, although we did have a lot of help, a few more sample codes for things like JTAPI and SIP would have been great. We were often referred to great sites, where we could find this information, but sorting through information of huge sites can sometimes be a fruitless effort. With the experience that the staff has, they are in a better position to identify useful code and information.
One possible step to look into could be towards encouraging interaction between Signaling groups of different teams. I know that this sort of interaction certainly helped James in our gateway team. But for those of us who are not friends with each other a possible solution is common brain storming sessions. This way we can help each other come up with ideas, exchange problems that other had encountered and possibly make friends with people for further interaction.
I also feel that the workload among the teams was somewhat unevenly. It would be a good idea to make sure that core components like Gateway, Signaling and Data Exchange have more people working on them. I feel steps should also be taken to find out people's interest in the development of a certain component, rather than making First come first served assignments. This step can help the entire group best utilize the talent the group as well keep people motivated in doing a good job.
References