JPhone: An Extensible Platform for Telephony Applications

MOTIVATION

Developments in both the hardware and software associated with telephone systems have lead the way towards increasing interaction between computers and the telephone network.

Computer systems are now used route customer service calls, read email over the telephone, as well as provide conventional answering machine and fax services. Many products on the market today are aimed at creating new applications and new services.

JPhone strives to meet the challenges of this new technology, by providing an extensible environment for developing these types of applications. Since no two users will require exactly the same services, JPhone offers a platform on top of which custom applications may be implemented.

Imagine purchasing a piece of third-party software and then uploading this application to the phone company's server to handle your telephone calls. Imagine writing this software yourself. JPhone makes scenarios like this possible through state-of-the-art hardware and an operating systems layer to Java called J-Kernel.

COMPUTER/TELEPHONY INTEGRATION (CTI)

Recently telephony equipment manufactures have begun to bridge the gap between traditional telephone switches and desktop-based PCs. JPhone takes advantages of two specific pieces of hardware.


J-KERNEL

Flexibility, as seen in an extensible platform like JPhone, requires a clear boundary between software written by third-parties (or users) and that written by the phone company and other users. If we allow users to upload arbitrary code, then we must be sure that this code can not interfere with code written by other users, or worse yet, the platform itself.

To provide protection between these different domains, JPhone uses an protection layer called J-Kernel. The J-Kernel is a portable, Java-based system that extends the underlying Java Virtual Machine (JVM) to provide multiple protection domains as well as well-defined communication channels between the domains.

In the J-Kernel, these protection domains are called tasks. Objects within a single task interact just as if they were objects in an ordinary JVM- there is no additional security at this level. If, however, an object in one task wishes to share information with object in another task, then this communication must take place through a special object called a capability. Capabilities represent access to specific data and behaviors in another task and are the only way to communicate with another task, so the interactions between tasks are well-defined.

SERVLETS

JPhone uses servlets to implement many of its services and applications. These servlets are an extension of Sun Microsystems's servlets.

So what are servlets?

Servlets are to servers what applets are to clients. They extend the functionality of the server and are able to handle multiple requests concurrently. They can also interact with each other by forwarding requests to other servlets.

Some applications for traditional servlets: generating dynamic web pages, e-commerce, online databases and, now, internet telephony.

PHONE SERVLET API

We've added more flexibility to the Java Servlet API by extending the Servlet interface. The PhoneServlet interface allows servlets to receive notification when a phone call is initiated. The PhoneServlet API also includes abstractions for Dialogic and Lucent hardware, the VoiceChannel and CallRouter interfaces, respectively.

Control events, like DTMF notification and call termination, are sent to the servlet through a FIFO queue called the CallEventStream. Audio data, on the other hand, is sent through an auxiliary data stream.


		...
		// Collect DTMF digits...
		CallEvent current = null;
	
		// Play wave file to ask for digits.
		current = play( askForDigits, channel, null);
		
		String digits = "";

		while( true)
		{
			current = ces.getNextEvent(); // Get the next event in the queue.

			if( current instanceof CallDroppedEvent) // The caller hung up, so exit.
			{
				channel.stopPlay();
				return null;
			}
			else if( current instanceof DigitReceivedEvent) // We've received a digit!
			{
				char digit = ((DigitReceivedEvent)current).getDigit();
								
				if( digit != '*')
				{
					digits += digit; // Concatenate the new digit.
				}
				else // If it is a star then return the string of digits.
				{
					channel.stopPlay();
					return digits;
				}
			}
			
		}
		...

FUTURE DEVELOPMENTS


REFERENCES

WWW:

JPhone www3.cs.cornell.edu/telesys
J-Kernel www.cs.cornell.edu/jkernel
JTAPI www.javasoft.com/products/jtapi
Servlets jserv.javasoft.com
Lucent www.lucent.com
Dialogic www.dialogic.com


Email:

JPhone telesys@cs.cornell.edu
Dan Spoonhower spoons@cs.cornell.edu
Nadine Latief nadine@cs.cornell.edu
Eva Luther luther@cs.cornell.edu
Thorsten von Eicken tve@cs.cornell.edu