Click here to Skip to main content
6,631,404 members and growing! (17,275 online)
Email Password   helpLost your password?
Web Development » Applications & Tools » Applications     Intermediate License: The Code Project Open License (CPOL)

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

By Aman Bhullar

Customer Support chat solution build using ASP.NET(2.0) with C# and XML as a database.
C# 2.0, ASP.NET, Ajax
Posted:9 Nov 2008
Updated:16 Dec 2008
Views:16,772
Bookmarked:56 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
13 votes for this article.
Popularity: 4.46 Rating: 4.00 out of 5
2 votes, 15.4%
1

2

3
5 votes, 38.5%
4
6 votes, 46.2%
5
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


Member
I make software
Occupation: Web Developer
Location: India India

Other popular Applications & Tools articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 44 (Total in Forum: 44) (Refresh)FirstPrevNext
GeneralNew Improvements? Pinmemberrodusa200719:09 29 Sep '09  
GeneralRe: 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  
GeneralWhat if u want to chat with ur friends Pinmembervaah9:05 24 Jul '09  
GeneralRe: 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  
GeneralRe: Message is showing arlivesupport PinmemberAman Bhullar6:54 29 Jun '09  
GeneralRe: Message is showing arlivesupport Pinmemberplatso_5884:57 7 Aug '09  
GeneralRe: Message is showing arlivesupport PinmemberAman Bhullar6:52 7 Aug '09  
GeneralHi help me out PinmemberWelcome Dhinesh2:17 12 Jun '09  
GeneralRe: Hi help me out PinmemberAman Bhullar7:28 12 Jun '09  
GeneralRe: Hi help me out PinmemberRohit_kakria2:31 29 Jun '09  
GeneralRe: Hi help me out PinmemberAman Bhullar6:49 29 Jun '09  
QuestionIntegrating with my application Pinmemberriya312:53 9 Apr '09  
AnswerRe: Integrating with my application PinmemberAmandeep Singh Bhullar6:53 9 Apr '09  
GeneralRe: Integrating with my application Pinmemberriya3121:08 9 Apr '09  
Generali have problem Pinmembercangokdemir13:18 26 Mar '09  
GeneralRe: i have problem Pinmembercangokdemir2:03 27 Mar '09  
GeneralRe: i have problem PinmemberAmandeep Singh Bhullar8:38 27 Mar '09  
GeneralChat styling Pinmemberkaren longstaff14:53 22 Mar '09  
GeneralRe: Chat styling PinmemberAmandeep Singh Bhullar6:26 25 Mar '09  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 16 Dec 2008
Editor: Deeksha Shenoy
Copyright 2008 by Aman Bhullar
Everything else Copyright © CodeProject, 1999-2009
Web22 | Advertise on the Code Project