Your SlideShare is downloading. ×
HamzaThesis.doc.doc
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

HamzaThesis.doc.doc

299
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
299
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. AJAX/VOIP CHAT by Hamza Quick A thesis submitted in partial fulfilment of the requirements for the degree of B.Sc Computer Science Honours University of the Western Cape Date:Tuesday,20March2007
  • 2. University of the Western Cape Abstract AJAX/VOIP CHAT By Hamza Quick Professor Isabella Venter Department of Computer Science Chat applications have become widely used in recent years, undoubtedly thanks to the continuing growth of the Internet and instant messaging. They have also become a practical and indispensable means of real-time communication among virtually anybody world-wide. The improved performance of network servers in recent years makes the use of instant messaging within a web applications resource manageable. Ajax (also known as AJAX), shorthand for Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user requests a change. This is meant to increase the web page's interactivity, speed, and usability (http://en.wikipedia.org/wiki/AJAX, 2007). AJAX technology is used to smoothly refresh (no flicker) and display the chat and nickname zone. Bandwidth is preserved because the server never transmits the same data twice, only new messages are transmitted. The idea of using the Internet as an alternative to the telephone network is not new and the software that now makes it possible is Asterisk, which can now convert any computer in to a telephone exchange.
  • 3. TABLE OF CONTENTS Table of Contents.............................................................................................................ii List of figures...................................................................................................................iii Acknowledgments...........................................................................................................iv Glossary.............................................................................................................................v Chapter 1....................................................................................................................3 User Requirement Analysis..............................................................................3 Introduction..................................................................................................3 User’s view of the problem.........................................................................3 Problem domain ........................................................................................4 Complete description of the problem.......................................................4 Software Expectations..........................................................................4 Not expected from a software solution....................................................5 Conclusion....................................................................................................5 Chapter 2....................................................................................................................6 Requirements analysis document......................................................................6 Introduction..................................................................................................6 Designer's interpretation of the user's requirements...............................6 Problem breakdown ...................................................................................7 Identify existing solutions...........................................................................8 Identify alternative technical solutions......................................................8 Test Solution ................................................................................................8 Conclusion....................................................................................................9 bliography........................................................................................................................10 Index..................................................................................................................................3 Appendix A.......................................................................................................................5 Work Plan............................................................................................................5 First Term.....................................................................................................5 ii
  • 4. LIST OF FIGURES Number Page [Click and insert List of Figures] iii
  • 5. ACKNOWLEDGMENTS The author wishes to [Click and type acknowledgments] iv
  • 6. GLOSSARY AJAX: Asynchronous JavaScript and XML: The functionally that is newly available to all web users is "in-page replacement": the ability for a web page to change using data from a web server without totally redrawing itself ASTERISK: open source telephone system, Asterisk is a complete IP PBX. Asynchronous: Is the sending of data blocks, for example symbols, characters or data packets, at any point in time, using variable time interval separating the transmission of the blocks. The most significant aspect of asynchronous communications is variable bit rate, or that the transmitter and receiver clock generators do not have to be exactly synchronized. Chisamba: Newest version of K.E.W.L, written in Php 5. GNU (Gnu's Not UNIX): A project sponsored by the Free Software Foundation that develops and maintains a complete software environment including operating system kernel and utilities, editor, compiler and debugger. v
  • 7. HTML (Hypertext Markup Language): Is the set of markup symbols or codes inserted in a file intended for display on a World Wide Web browser page. IP: Internet Protocol. The Internet Protocol (IP) is the method or protocol by which data is sent from one computer to another on the Internet. MSN (Microsoft Network): Microsoft's Internet service provider MySQL. (pronounced "my ess cue el") is an open source relational database management system (RDBMS) that uses Structured Query Language (SQL), the most popular language for adding, accessing, and processing data in a database. Because it is open source, anyone can download MySQL and tailor it to their needs in accordance with the general public license. MySQL is noted mainly for its speed, reliability, and flexibility PBX (private branch exchange): Is a telephone system within an enterprise that switches calls between enterprise users on local lines while allowing all users to share a certain number of external phone lines PHP: Is a scripting language used for web applications and creation of dynamic web pages. PHP means “PHP: Hypertext Preprocessor. PSTN (public switched telephone network): Is the world's collection of interconnected voice-oriented public telephone networks, both commercial and government-owned. SIP (Session Initiation Protocol): Used inside Asterisk. The SIP protocol is responsible for setting up the calls and signalling. Synchronous: Through synchronous communications, data is transmitted as frames of large data blocks rather than bulky individual bytes.
  • 8. VOIP (Voice over Internet protocol): A technique using hardware and software that enables people to use the Internet as the transmission medium for telephone calls by sending voice data in packets using IP rather than by traditional circuit transmissions of the PSTN. XAJAX: The xajax PHP object generates JavaScript wrapper functions for the PHP functions you want to be able to call asynchronously from your application. Xampp The acronym LAMP refers to a set of free software programs commonly used together to run dynamic Web sites or servers:* Linux, the operating system;* Apache, the Web server;* MySQL, the database management system (or database server);* Perl, PHP, and/or Python, scripting languages. XML (Extensible Markup Language): is a W3C-recommended general-purpose mark-up language that supports a wide variety of applications. XML languages or 'dialects' may be designed by anyone and may be processed by conforming software. XMLHttpRequest: As deployment of XML data and web services becomes more widespread, you may occasionally find it convenient to connect an HTML presentation directly to XML data for interim updates without reloading the page. 2
  • 9. Chapter 1 USER REQUIREMENT ANALYSIS Introduction This chapter describes specifically the problem from the user’s perspective. Three types of users have been identified, namely: (1) a typical user interacting with all the systems functionality, (2) a hearing impaired user interacting with specific functionality, (3) the administrator overseeing and controlling these processes. User’s view of the problem The user expects an easy to use interface with a simplistic feel and navigation. In terms of functionality, the user expects a chat environment that sends and receives quickly. The user would also expect that the user list should be automatically updated whenever a new user logs in and logged in users can be selected anytime for on-line private chatting. Since the system is not web-based the user in not compelled to install the system. The user is only required to start-up a browser type in the correct address and login to the system. User expects to be able to select a user and using a microphone, speck to that selected user. The hearing impaired user will use the text-to-voice system as an alternative to the voice communication. 3
  • 10. Problem domain This chat application is designed as a communication tool for hearing and hearing impaired users. Within the communication domain the system uses the possibility of carrying telephone conversations as IP packets, classical text-to-text, and text- to-voice and voice-to-text functionality. Complete description of the problem The internet has fast become a complete communication channel between users. This communication channel has expanded from being simply text-based to incorporating voice and video. The average user with internet connection would like to be able to activate an internet browser, login to a system and be able to communicate (using the above mentioned channels) with various users on internet. Currently the speed of the average user’s internet connection is at a performance level more conducive for only the text-based communication. This means that using the normal voice/audio and video communication channels would introduce a whole new level of latency. Hearing impaired users are unable to use the voice/audio communication channel and would like to accept voice communication that could be transformed to text and would also like to send text which could be transformed into voice. The idea of this is to bridge the gap between hearing impaired users and the hearing users. Software Expectations This system consists of a chat application integrating various communication channels. As a result, two user-roles have been identified, namely administrator and the user. The user roles are further divide into two sub-user user profiles that distinguish between the hearing users and hearing impaired users. The administrator’s role is basically to assign permissions, add users, remove users and 4
  • 11. generally maintain and over-see the communication between users. . The two users should be able to login to the system and communicate effort-less, through the available channel of communication. Not expected from a software solution The system is not expected to facilitate a large number of users. Also the system is not expected to process large amounts of simultaneous user requests for multimedia file transfers. The system will not archive chat sessions and is not intended to be general solution which works in all possible environments. Conclusion In this chapter the various users of the system have been identified. Their perspectives of the environment and chatting facilities have been analyzed and project domain has also been identified. What the user expects and what is not expected from the software is distinctly listed. 5
  • 12. Chapter 2 REQUIREMENTS ANALYSIS DOCUMENT Introduction In the pervious chapter we defined the entire system from the user’s perspective. Were as in this chapter we begin to look at the problem from a designer perspective. We also do analysis on the system and divide it into three components. The first component of the system is the interface which the user interacts with. The second being the Voice over IP (VoIP) communication platform incorporating voice-to-text as well as text-to-voice for hearing impaired users. The third component involves the back-end database which stores information regarding the various users and user-roles which basically serves as a system administration. Designer's interpretation of the user's requirements This system should provide the user with a text-based messaging interface. The user should also be able to communicate using the VoIP channel as an added feature to the text-based communication. Since the system carters for hearing impaired users, the alternative to the VoIP is voice-to-text and text-voice functionality. The system should also make use of administrative functionality to govern the various users and allow for the addition, deletion and modification of users in the database. 6
  • 13. Problem breakdown We analysis the systems three key components, beginning with the systems messaging interface which will be written in PHP within an existing frameworks namely, Chisamba frameworks. The system will integrate into the frameworks as a module among other modules. This interface comprises of an synchronous text-based mechanism for multiple users to post messages, associate user names with these messages, and display and update the last several messages so that chat visitors can follow the ongoing discussion. The system also allows for multiple user as well as one-on-one sessions. This communication channels is driven by Asynchronous JavaScript and XML (AJAX). AJAX is a technology that is useful within a text-based environment for its in-page replacement functionality which is the ability for a web page to change using data from a web server without totally redrawing itself. This allows the user to update the messaging portion of a page when the submit button is clicked.. It also has the ability to send as well as receive information in a various formats, including XML, HTML, and even text files (Jesse James Garrett, 2005). The interface for the VoIP component that well be used is the soft phone, which is a graphical interface between the server and the users. The second component in system is the VoIP platform. In this particular component, a user’s voices will have to be transmitted, so we opted to use asterisk, a free and open source implementation of a telephone exchange (Rich Tehrani, 2006). There are two VoIP protocols that can be used, the first one is Session Initiation Protocol (SIP); responsible for setting up the calls and signalling whether there is a busy line, ring tones or that some one has answered on the other end of the line .The other protocol is Inter-Asterisk eXchange (IAX) protocol that minimises the use of bandwidth per single call. SIP uses two separate pairs of data streams, one for signalling and one for voice, were as IAX uses a single data stream to communicate between terminals. 7
  • 14. The system third component will consist of a simple administration structure. The administrator will be able to govern the users, with the ability to add, delete modify users on the system. All this information will be store within a MySQL database on the same PC as the asterisk server and apache server. Identify existing solutions A VoIP alternative can easily be divided into two main groups: closed proprietary and open systems. In the first group we find the very popular Skype. Among the second group we find open standards based on SIP and IAX. Identify alternative technical solutions An alternative to the AJAX technology is Jabber an open source instant messaging services like Microsoft Network (MSN), and Yahoo, it is a set of streaming XML protocols and technologies that enable any two entities on the Internet to exchange messages, presence, and other structured information in close to real time. An alternative solution to asterisk implementation within the VoIP platform would be an Open source telephony application server called Gnu's Not UNIX (GNU) Bayonne. GNU Bayonne, the telecommunications application server of the GNU project, offers free, scalable, media independent software environment for development and deployment of telephony solutions for use with current and next generation telephone networks. Test Solution Testing this system would require two or more users to connect to apache server that is hosting the chisamba frameworks with chat module installed. The asterisk server would also reside on this machine and would concurrently and in parallel 8
  • 15. with the apache server. The users could then connect to the frameworks via a browser, login and begin to communicate. The asterisk server would be tested for latency and jittering as the voice packets is transferred. The AJAX requests both on the client side and server could be check by measuring the processing times between the requests. Conclusion In this chapter we dealt with the problem from the designer point of view. The system was broken down into it three component and analyzed in depth. Various solutions were stated for the three components along with alternative solutions and a test solutions structured based on the best solution discovered. 9
  • 16. BLIOGRAPHY Ajax (programming). (2005). available http://en.wikipedia.org/wiki/AJAX. Dynamic HTML and XML: The XMLHttpRequest http://developer.apple.com/ internet/webcontent/xmlhttpreq.html (2004) http://www.adaptivepath.com/publications/essays/archives/000385.php (2005) Jesse James Garrett, (2005) ,”Ajax: A New Approach to Web Applications”, Prototype Tips and Tutorials (2006): http://www.prototypejs.org/learn Rich Tehrani, (2006), “Big VoIP Revenue for Small Potato Providers” http://www.netsapiens.com/netsapiens.html Use Ajax with PHP and DB2 9 –Xajax, (2006) http://devzone.zend.com/node/ view/id/1636 10
  • 17. INDEX AJAX v 3
  • 18. APPENDIX A In this term the time was mostly spent doing research. Much investigation had to be done to identify and structure the projects direction. Becoming acquainted with the communication channels for the project, such as the Xajax, Prototype and Asterisk took a large portion of time. These communication channels required first understanding how they work and then structuring there usefulness into a project plan. However, Asterisk not only required time to understand how to use it to test whether it could be integrated within the frameworks used by the chat application. WORK PLAN First Term Date Task Progress Tues 6th Feb  Creating thesis document using Honours Project Guidelines, Fill 15h00 (BANG) in headings  Investigating the usefulness of Asterisk  Researching integration of Completed Chisamba/K.E.W.L frameworks with asterisk  Researching literature on Asterisk and Ajax Tues 13th Feb  Complete the thesis outline Completed 13h30 (using Honours Project
  • 19. Guidelines)  Fill in the abstract , list 10 keywords for the glossary  Start write-up of URD.  Fill in headings  Investigate alternative to Ajax, namely Prototype.  Research the Prototype concept  Discuss requirements with the users,  Create website Tues 20th Feb 15h00 (BANG)  Configure Asterisk on local machine  Setup Asterisk on the server, configure using SIP protocol  Add any literature found to your Completed bibliography – use Harvard Notation  Collaborate with Chisamba Developers to fine-tune what you intend to do.  Put plan onto website Mon 26th Feb  Start with RAD. 8h30  Complete URD  Start write-up of RAD. Completed  Download current version of Chisamba to local system as well as apache server needed to running frameworks Tues 6th March Completed
  • 20. 15h00 (BANG)  Bibliography – at least 5 entries.  Write-up RAD  Check Index and add indexes  Get Chisamba to work on your system & play around with it!  Add URD to website Date Task Progress Fri 17th March  Finalise write-up. Let someone 12h00 proof read  Complete RAD Completed  Use thesis to Prepare slides for mock presentation  Add RAD to website Tues 20th March  Hand in final document on Friday 15h00 (BANG) (23rd March) before 12h00. Completed  Mock presentation Tues 3rd April Completed 12h00