Click here to Skip to main content
Licence CPOL
First Posted 9 Nov 2008
Views 40,790
Downloads 1,185
Bookmarked 69 times

A. R. Live Support: XML Based Customer Support Chat Solution

By Aman Bhullar | 16 Dec 2008
Customer Support chat solution build using ASP.NET(2.0) with C# and XML as a database.
2 votes, 11.1%
1

2

3
6 votes, 33.3%
4
10 votes, 55.6%
5
4.57/5 - 18 votes
2 removed
μ 4.16, σa 2.25 [?]
ChooseChannel.jpg

UserWindow.jpg

AgentResponse.jpg

Introduction

I have checked out a lot of chat solutions and all of then were database driven. These applications fail as soon as the database is down and in live systems, this scenario is not unknown. So, I decided to build a Chat Solution that should be database independent. So, XML is the best replacement.

This is my first article and A. R. Live Support is the first solution I have developed using XML.

Background

A. R. Live Support is an online chat software, developed in ASP.NET(2.0) and XML. It is easy to use and facilitates 1-o-1 live communication between customers and executives. It is a flexible live chat software that provides the customer support with a click.

The main features are:

  1. Built with HTML, JavaScript, XML, C#, using Ajax techniques
  2. NO DATABASE: No need for a database (since it is XML based)
  3. No Flashing: Based on advanced Ajax techniques, the chat screen refreshes every second(this can be customized), and changes on the screen do not require a screen refresh
  4. NO ACTIVEX or PLUGINS, etc. - because it is not Java based, the user does not need to install plugins, or have Java components on the machine. A combination of JavaScript, XML and C# ASP.NET makes this possible.
  5. NO MEMORY STORAGE for messages, users; everything gets stored in XML files. This feature allows several chat rooms and even chat applications to run on the same server.
  6. EASY TO INSTALL - Just unzip a *.zip file on the server, create a virtual directory, and the chat is ready.
  7. ANY MAJOR BROWSER OK - Internet Explorer, Netscape, Mozilla Firefox, Opera

Code Walkthrough

  1. I will start from a code that will be used to call the Server repeatedly for fetching the most recent information:

    function InitializeTimer()
    {
        // Set the length of the timer,
        // in seconds. Your choice
        secs = 2;
        StopTheClock();
        StartTheTimer();
    }
    function StopTheClock()
    {
        if(timerRunning)
            clearTimeout(timerID);
        timerRunning = false
    }
    function StartTheTimer()
    {
        if (secs==0)
        {
            StopTheClock();
    	ajax_MakeAnAJAXGetCall();
            //Generate a Postback to the server
            InitializeTimer();
            // Start the timer again
        }
        else
        {
            secs = secs - 1;
            timerRunning = true;
            timerID = self.setTimeout("StartTheTimer()", delay);
        }
    }
    
    //AJAX Function
    function makeRequest()
    {
    	var xmlHttpRequest = null;
    	/*
    	* For Firefox, Mozilla, Safari
    	*/	
    	if (window.XMLHttpRequest)
    	{
    		xmlHttpRequest = new XMLHttpRequest();
    	}
    	/*
    	* For Microsoft Internet Explorer
    	*/
    	else if (typeof ActiveXObject != "undefined")
    	{
    		xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
    	}
    	return xmlHttpRequest;
    }//END of Function makeRequest
    
    function ajax_MakeAnAJAXGetCall()
    {
    	ajaxObj = makeRequest();
    	//alert('HELLO');
    	if (ajaxObj != null)
    	{
    		var dt = new Date();		
    		var URL = serverURL;
    		URL += '?id=' + document.getElementById('lblID').innerHTML + 
    			'&dt1=' + dt.getHours()+ '&dt2=' + dt.getMinutes();
    		//alert(URL);
    		StopTheClock();
    		ajaxObj.open("GET", URL, true);
    		ajaxObj.onreadystatechange = ajax_CallBack;
    		ajaxObj.send(null);
    	}
    	else
    	{
    		
    	}	
    	return false;
    }
    
    function OpenPop(strId)
    {
        window.open('execChatWindow.aspx?id=' + strId,'','width=520,height=490');
    }
    
    function ContactServer()
    {
    	ajax_MakeAnAJAXGetCall(); //THis makes Ajax call to run 
    }
  2. Server side code to fetch the messages for User/Executive:

    string strResult = string.Empty;
    try
    {
      string chatId = Request.QueryString["cid"].ToString();
      string strXML = chatId + ".XML";  
      strResult = clsChatMessages.getUnReadMessages(Request.PhysicalApplicationPath, 
    		strXML,Request.QueryString["id"].ToString(), true);
    }
    finally
    {
    
    }

Points of Interest

  1. Chat is fully customizable, i.e. there are a lot of interesting settings in web.config.
  2. Initially it does not provide any reporting, but that can be generated using XML files.

History

  • 09-Nov-2008
    • Initial post of article
  • 18-Nov-2008
    • Selection of Departments for the Chat
    • [Bug Fix] in chat allocation
  • 16-Dec-2008
    • Chat Transfer between Executives
    • Password Encryption [RSA]

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Aman Bhullar



India India

Member


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionMalicious code block PinmemberMember 845737912:02 5 Dec '11  
Questiondepartmen Pinmembertolgagim13:39 13 Nov '11  
AnswerRe: departmen PinmemberAman Bhullar7:17 21 Nov '11  
Questioncan you upload class file also. instead of dll Pinmemberktoby11:18 16 Jul '11  
GeneralHi Pinmemberdavidcandia12:36 30 Apr '11  
GeneralRe: Hi PinmemberAman Bhullar7:07 17 May '11  
GeneralMy vote of 5 Pinmemberbahmandb10:26 29 Apr '11  
Generalfull solution Pinmemberamr rabie13:04 17 Apr '11  
GeneralRe: full solution PinmemberAman Bhullar7:00 25 Apr '11  
GeneralRegarding the flow of this application PinmemberMember 39001724:14 29 Dec '10  
GeneralRe: Regarding the flow of this application PinmemberRohit_kakria2:12 3 Feb '11  
GeneralRe: Regarding the flow of this application PinmemberAman Bhullar5:34 3 Feb '11  
GeneralMy vote of 4 PinmemberPablo Castillo9:32 16 Aug '10  
GeneralSecurity Awareness PinPopularmemberbokohut7:44 3 Dec '09  
GeneralRe: Security Awareness Pinmembertheripevessel9:40 14 Jan '10  
QuestionNew Improvements? Pinmemberrodusa200719:09 29 Sep '09  
AnswerRe: New Improvements? PinmemberAman Bhullar6:24 30 Sep '09  
GeneralNeed to implement chat on asp.net project PinmemberMasakhane1:04 10 Sep '09  
GeneralRe: Need to implement chat on asp.net project PinmemberAman Bhullar7:11 10 Sep '09  
QuestionWhat if u want to chat with ur friends Pinmembervaah9:05 24 Jul '09  
AnswerRe: What if u want to chat with ur friends PinmemberAman Bhullar6:30 27 Jul '09  
GeneralRe: What if u want to chat with ur friends Pinmembervaah6:35 27 Jul '09  
GeneralRe: What if u want to chat with ur friends PinmemberAman Bhullar6:41 28 Jul '09  
QuestionMessage is showing arlivesupport PinmemberRohit_kakria3:25 26 Jun '09  
AnswerRe: Message is showing arlivesupport PinmemberRohit_kakria23:37 26 Jun '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120209.1 | Last Updated 16 Dec 2008
Article Copyright 2008 by Aman Bhullar
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid