FINAL REPORT

 

December 18, 1998

Group: Phonetics (Group #4)

Team Members: Joy Alamgir (ID # 379220)

Pemith Randima Fernando (ID # 379814)

Task: Team 7 (Voice-Email Gateway)

 

[1] - What We Set Out To Do

We set out to write a voice-mail system to match and extend the specifications delineated in the course web page project description. Our goal was to come up with an application and framework that would satisfy these specifications, but yet be simple and streamlined so that ordinary users would be able to implement it easily. In addition, we tried to make our goals realistic so that we would be able to achieve them. More specifically, we aimed to implement the following features:

A flowchart that depicts our system can be found in Appendix A. Below is a step-by-step explanation of that flowchart:

    1. Wait for a call from signaling: we run in a continuous loop while waiting for signaling to tell us that there is an incoming call
    2. Play introduction: play an introductory message that gives the user two choices: (a) leave a message for another user, or (b) enter an access code to reach the main voice menu.
    1. Play main voice menu: play out the various choices for the user, and then get a selection. The choices in the voice menu are:
    1. Get selection and take appropriate action:
    1. Quit: save the database, close the connection, notify underlying layers, and jump back to Step 1.

[2] – What We Accomplished

Through the course of the semester, we accomplished a great deal. We worked on a variety of different areas:

Overall Database-Related

public void ClearDatabase()

public void PrintDatabase()

public int LoadDatabase(String path)

public int SaveDatabase(String path)

public void FillVMUser(int index, VMailUser vmu)

public int getMaxEmails()

public int getMaxMessages()

public int getMaxRecords()

User Info Lookups

public int VerifyCode(int code)

public int VerifyNumber(int number)

public String getUsernameForCode(int code)

public String getUsernameForNumber(int number)

public int getIndexForUsername(String username)

E-mail Related

public void ClearEmails(String username)

public int EmailExists(String username, String path)

public String EmailPath(String username, int email_index)

public void AddEmail(String username, String path)

public void DeleteEmail(String username, String path)

public boolean isParsed(int number, String fname)

public void setParsed(int number, String fname, boolean val)

public boolean EmailIsRead(int number, String fname)

public void EmailSetRead(int number, String fname, boolean val)

public boolean EmailIsProcessed(int number, String fname)

public void EmailSetProcessed(int number, String fname, boolean val)

Message Related

public String AddMessage(int number)

public String AddMessage(String username)

public String IsMessage(int number, int msg_num)

public int DeleteMessage(int number, int msg_num)

public boolean MessageIsRead(int number, int index)

public void MessageSetRead(int number, int index, boolean val)

public void addGreeting(int number, String fname)

public void deleteGreeting(int number, String fname)

[3] – Problems We Encountered

Essentially the problems we encountered were the ones that we addressed in the Work Completed section (i.e., finding a mail server, getting interfaces fully refined, making a database, etc…) The following are the biggest problems we found that we would have liked to have found more elegant solutions to:

 

[4] - What We Learned

[5] - Mistakes We Made

[6] - Interfaces

From Gateway:

Our interface with gateway was primarily directed towards tone detection. However, eventually to facilitate record and playback options we used the getDigits function to signal to gateway when to send us packets, when to receive packets from us apart from the usual tone detection objective.

//Constructor

public gatewayRequest()

//Tone Detection

//We also use this function to let gateway know we want to play out a file (i.e. request 8 digits)

//inform it of a hangup (i..e. request 9 digits), inform it of of our intention to record to a file

//(i.e. request 0 digits)

public static String getDigits (int linenumber, int numberdigits)

To Signaling:

We were the first application to have a working interface with signaling. The signaling interfaces for the other applications were based on our design. To that end, we had to spend a significant amount coordinating with the signaling team to make the interface simple, robust and easy to build upon.

The Signaling interface basically provides call initiation functions, call hangup functions and a status function.

//Constructor

public VMail_Accept( ){

}

//if there's a call for voicemail...call this function

//it will return 1 if voicemail accepts the call

//0 otherwise

public int Accept_call( );

// starts a call

//the flag should be 1 if it's a telephone to pc call

//otherwise it should be 0

//if flag is 1 then

//port should be the port number or line number to connect

//to gateway with, and IP_addr should be Gatway's IP_addr

//if flag is 0 then port should be the port of the remote

//computer trying to connect to us....ip_addr should be the

//IP addr of the remote computer

public int start_call(int port, int flag, String IP_addr);

// lets us know when a call has ended

public int Vmail_Hangup(int line);

// lets us know when a call has ended

public int Vmail_Hangup(String IP, int port);

// this function returns 1 if a connection is alive

//0 if the connection is not alive

//The IP_addr is the IP_adde of the computer we are connected to

//If we are connected to a telephone, then the IP_Addr is gateway’s IP

//and the line number is the line number we are connected to

public int isAlive(String IP, int line)

From Signaling:

Again, we were the first app to coordinate with signaling what functions they should give us. Since we never dialed a user, we never needed a dial function from them. We coordinated with them with the specifics of a Voicemail Hangup function which we use to tell signaling our intention to hangup.

//We call this function to let signaling know we want to terminate a connection

public boolean vMailHangup(String destIP, String port, String lineNo)

From Datapath:

We used Datapath’s dll to playout a wave file, save to a wave file, and play out raw audio data. The following are the functions they provided to us.

//We call this function to let datapath know who we want to connect to

public static native boolean AddSenderTo(byte[] destAddress, int iPortNum);

//This is the wave file we want to play out. This can also be a raw audio file but the extension must be .raw

public static native boolean SetLocalInputFile(byte[] fileName);

//This is the file we save to when we record a message

public static native boolean SetLocalOutputFile(byte[] fileName);

//After calling the above functions and initializing as necessary we call

//this function to establish a connection and initiate packet transfer

public static boolean CreateConnection();

From Management:

Management basically needed functions to get our current users, get their status, add users to our database, delete users from our database. Due to time constraints we were not able to provide the the delete users function but all the other functionality was provided. They provided us with a thread that periodically queried us about our status.

//Initialize Management Thread with an instance of us

public PMServerVoiceMail(Vmail_Server whomadeus);

//Run the management Thread

public void run ()

 

To Management:

//Management calls this function from their thread. We pass an instance

//of us to them and they can access our public functions

public void getVMailStat(VMailStat v);

//Add a user to our database

public void AddUserToDatabase(int code, int number, String username) ;

From Directory Services

We call directory service to register our location with the directory so that signaling knows which calls are Voicemail calls and which are not.

If we crash, we need to deregister myself and reregister myself again

// adds new user to directory

// Email: user's email

// Extension: user's extension -- used to uniquely identify the user with a number for phone-to-PC calls

// Password: password, may be empty

// Week: 7-bit array. Each bit represents one day of the week (0 - Monday, ...). 1's define one

// group of days and 0's another. Example: 0000011 -- Monday- Friday are group 0; Saturday, Sunday are group 1

// Group0Time?: 3 numbers between 1 and 24 used to split each day in group 0 into 4 time periods.

// Ex: Group0Time0 is 9, Group0Time1 is 17, Group0Time2 is 20 means that period 0 is midnight-9am,

// period 1 is 9am-5pm, period 3 is 5pm-8pm, period 4 is 8pm-midnight.

// If the user does not want to specify all 4 time periods, just set unwanted Group0Time? arguments to 24

// Ex: Group0Time? are all 24 means that the whole day is just one period

// Group1Time?: same thing as Group0Time?, but for days in group 1

// returns true if succeeds, false if fails

boolean AddUser(String Email, int Extension, String Password, BitSet Week, byte Group0Time0, byte Group0Time1, byte Group0Time2, byte Group1Time0, byte Group1Time1, byte Group1Time2);

boolean RemoveUser(String Email, String Password);

Billing:

We do not directly communicate with Billing. Signaling takes care of that on our behalf.

[6.5] – System-Sock J

This is a C++ program that ran perpetually on cs519pnt. Its basic task was to listen on a socket for a signal from our main VMail_Server application. Upon receiving a signal it called our MSAPI program that converted text-to-speech and then converted the wave files thus created into raw audio data (using Sox).

[7] – Advice for the Course Staff

[8] - References

http://java.sun.com:81/products/java-media/speech/forDevelopers/jsapi-guide/Synthesis.html#7621

http://java.sun.com:81/products/jtapi/implementations.html

http://www.real.com/devzone/library/creating/rmsdk/index.html

http://www.cs.cornell.edu/cs519/

Schulzrinne and Rosenberg, Internet Telephony: Architecture and Protocols an IETF Perspective

E-mail with Chris Bagwell (the author of Sox) and a number of other format-conversion people

 

 

 

APPENDIX A

Flowchart of VoiceMail System

 

Every stage after STAGE 1 listens for hang-up signal from signaling.




.