Click here to Skip to main content
16,012,223 members
Articles / Web Development / ASP.NET

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

Rate me:
Please Sign up or sign in to vote.
4.58/5 (22 votes)
16 Dec 2008CPOL2 min read 149.6K   5.4K   81   84
Customer Support chat solution build using ASP.NET(2.0) with C# and XML as a database.
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:

    C#
    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:

    C#
    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)


Written By
Team Leader
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 5 Pin
bahmandb29-Apr-11 9:26
bahmandb29-Apr-11 9:26 
Generalfull solution Pin
amr rabie17-Apr-11 12:04
amr rabie17-Apr-11 12:04 
GeneralRe: full solution Pin
Aman Bhullar25-Apr-11 6:00
Aman Bhullar25-Apr-11 6:00 
GeneralRegarding the flow of this application Pin
Member 390017229-Dec-10 3:14
Member 390017229-Dec-10 3:14 
GeneralRe: Regarding the flow of this application Pin
Rohit_kakria3-Feb-11 1:12
Rohit_kakria3-Feb-11 1:12 
GeneralRe: Regarding the flow of this application Pin
Aman Bhullar3-Feb-11 4:34
Aman Bhullar3-Feb-11 4:34 
GeneralMy vote of 4 Pin
Pablo Castillo16-Aug-10 8:32
Pablo Castillo16-Aug-10 8:32 
GeneralSecurity Awareness PinPopular
bokohut3-Dec-09 6:44
bokohut3-Dec-09 6:44 
All,

Having the background of development and security along with years of real world 'hacks' my spare time leads me to research others software products. My toolbox is filled with all kinds (mostly free) and my experience leads me to use them very effectively. This project in particular had my attention as it has a closed source component as clearly stated by the creator/poster. First and foremost I am not posting this to discredit them or their work but to make the community aware of their actions which in my opinion is clearly unethical and can, in some circles, be considered criminal.

My goal was to analyze this web based chat program with a closed source component. My focus was on the closed source component which, need I remind you, can be doing anything. I downloaded and compiled the web app and then used Cassini to run it. This test was only that, a test. If anyone is using this project in a 'real' business environment I would highly recommend you cease as my findings may convince you.

After tinkering for a while I started up WireShark prior to hitting the test site and upon Admin log on I see an HTTP request to "www.123zapak.com/livesupport/875924gwe28n89f22.aspx". Upon further research it is discovered that the dll is spawning a thread to push your url, hostname, and address. I do not know why they did this but I can only speculate to track who is using it and to potentially 'comeback' at a later time. Nearly everyone reading this being a developer will know how easy it would be for the closed source to be updated to include a user name and password. See the problem?

Two Words: "Full Disclosure"

I did not see anywhere in the code that was released of this activity being stated. I can therefore only speculate of their nefarious reasoning. To state starting a commercial business with such a disclosure can be bad in some light but as I already stated "Full Disclosure".

This analysis was conducted on code upload from early in 2009. If it has been updated since I did not review that code. Regardless it was present at one point in time. Before anyone gets all 'fired' up those following through will discover the site to longer be present, now a 'squatter' has it.

I regret this being my first posting as I believe it will not be well received but the news cannot always be good in the real world. If anything maybe the author can explain their actions and others can sleep easier knowing people like me are 'watching'. I truly appreciate all that codeproject has offered over the years.

Need I remind you to NEVER run any application, with source code or not, before reviewing in a sand boxed environment. If aware of recent technology news articles you may recall just recently the blind claims made about an NSA backdoor in Windows 7 because the agency 'helped' in securing the OS. While not even in the same universe as my above discovery you can see where analysis of any and all software is needed that is closed source. Does your company deal with private data and outsource development of the systems applications? 'Yes'? Then have extensive background checks been done on the third party employees? I could go on....

Tools used: VMware / Windows 2003 / MS C# 08 Express / MS Web 08 Express / Cassini / hMailServer / Thunderbird / Notepad++ / WireShark / .Net Reflector

PS: Out place but well deserved -> Keep up the amazing work Sacha.

Anyone wanting further information can contact me directly through a private email reply.

The only correct way to do it is to do it yourself.

GeneralRe: Security Awareness Pin
theripevessel14-Jan-10 8:40
theripevessel14-Jan-10 8:40 
QuestionNew Improvements? Pin
rodusa200729-Sep-09 18:09
rodusa200729-Sep-09 18:09 
AnswerRe: New Improvements? Pin
Aman Bhullar30-Sep-09 5:24
Aman Bhullar30-Sep-09 5:24 
GeneralNeed to implement chat on asp.net project Pin
Mongezi110-Sep-09 0:04
Mongezi110-Sep-09 0:04 
GeneralRe: Need to implement chat on asp.net project Pin
Aman Bhullar10-Sep-09 6:11
Aman Bhullar10-Sep-09 6:11 
QuestionWhat if u want to chat with ur friends Pin
vaah24-Jul-09 8:05
vaah24-Jul-09 8:05 
AnswerRe: What if u want to chat with ur friends Pin
Aman Bhullar27-Jul-09 5:30
Aman Bhullar27-Jul-09 5:30 
GeneralRe: What if u want to chat with ur friends Pin
vaah27-Jul-09 5:35
vaah27-Jul-09 5:35 
GeneralRe: What if u want to chat with ur friends Pin
Aman Bhullar28-Jul-09 5:41
Aman Bhullar28-Jul-09 5:41 
QuestionMessage is showing arlivesupport Pin
Rohit_kakria26-Jun-09 2:25
Rohit_kakria26-Jun-09 2:25 
AnswerRe: Message is showing arlivesupport Pin
Rohit_kakria26-Jun-09 22:37
Rohit_kakria26-Jun-09 22:37 
GeneralRe: Message is showing arlivesupport Pin
Aman Bhullar29-Jun-09 5:54
Aman Bhullar29-Jun-09 5:54 
GeneralRe: Message is showing arlivesupport Pin
platso_5887-Aug-09 3:57
platso_5887-Aug-09 3:57 
GeneralRe: Message is showing arlivesupport Pin
Aman Bhullar7-Aug-09 5:52
Aman Bhullar7-Aug-09 5:52 
GeneralHi help me out Pin
Welcome Dhinesh12-Jun-09 1:17
Welcome Dhinesh12-Jun-09 1:17 
GeneralRe: Hi help me out Pin
Aman Bhullar12-Jun-09 6:28
Aman Bhullar12-Jun-09 6:28 
GeneralRe: Hi help me out Pin
Rohit_kakria29-Jun-09 1:31
Rohit_kakria29-Jun-09 1:31 

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

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