Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9135065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:46:35+00:00 2026-06-17T08:46:35+00:00

My idea is to integrate a live support chat on a website. The users

  • 0

My idea is to integrate a live support chat on a website. The users text is send with xmpphp to my jabber client with the jabberbot sender id and if I answer, the jabber bot, takes my answer and transfers the text to the user.

There is only one problem. How do I separate different users or different chats? I don’t want all users to see the answer, but the user who asks. Is there a kind of unique chat id or another possibility, that I might just missed?

User => Website => Chatbot => me

I want to answer and send it back to the user, but how can I find out the correct user from my answer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:46:36+00:00Added an answer on June 17, 2026 at 8:46 am

    Last time I have to solve this problem I used this architecture:

    enter image description here

    Entlarge image

    The Webserver provides an JavaScript / jQuery or flash chat.

    After chat is started, the client ask the server all 1 Second for new Messages.

    Alternative for 1 Sec Polling

    If that is to slow for you, have a look at websockets.

    http://martinsikora.com/nodejs-and-websocket-simple-chat-tutorial

    http://demo.cheyenne-server.org:8080/chat.html

    But Websockets could no provided by php. There for you need to change php + apchache agaist node.js or java.

    Plain HTTP PHP Methode

    In PHP you will connect to the PsyBnc with is polling the messages from the supporter for you.

    The PsyBnc is an IRC bot.

    The reason why don’t directly connect to XMPP or BitlBee is that those protocols don’t like the flapping connect, disconnect from PHP. Because you can not keep the session alive, you need something that is made for often and short connects. This is the PsyBnc.

    I would use something like this:

    http://pear.php.net/package/Net_SmartIRC/download

    <?php
    session_start();
    
    $message = $_GET['message'];
    $client_name = $_GET['client_name'];
    
    if (empty($_SESSION['chat_id'])) {
        $_SESSION['chat_id'] = md5(time(). mt_rand(0, 999999));
    }
    
    if (empty($_SESSION['supporter'])) {
        // how do you select the supporter? 
        // only choose a free?
        // We send first message to all supporter and the first who grapped got the chat (where only 3 gues)
    }
    
    $irc_host = "127.0.0.1";
    $irc_port = 6667; // Port of PsyBnc
    $irc_password = "password_from_psy_bnc";
    $irc_user = "username_from_psy_bnc";
    
    include_once('Net/SmartIRC.php');
    
    class message_reader
    {
        private $messages = array();
    
        public function receive_messages(&$irc, &$data)
        {
            // result is send to #smartirc-test (we don't want to spam #test)
            $this->messages[] = array(
                'from' => $data->nick, 
                'message' => $data->message,
            );  
        }
    
        public function get_messages() {
            return $this->messages;
        }
    }
    
    $bot = &new message_reader();
    $irc = &new Net_SmartIRC();
    $irc->setDebug(SMARTIRC_DEBUG_ALL);
    $irc->setUseSockets(TRUE);
    $irc->registerActionhandler(SMARTIRC_TYPE_QUERY|SMARTIRC_TYPE_NOTICE, '^' . $_SESSION['chat_id'], $bot, 'receive_messages');
    $irc->connect($irc_host, $irc_port);
    $irc->login($_SESSION['chat_id'], $client_name, 0, $irc_user, $irc_password);
    $irc->join(array('#bitlbee'));
    $irc->listen();
    $irc->disconnect();
    
    // Send new Message to supporter
    if (!empty($message)) {
        $irc->message(SMARTIRC_TYPE_QUERY, $_SESSION['supporter'], $message);
    }
    
    echo json_encode(array('messages' => $bot->get_messages()));
    

    Connect the support instant messanger to PHP

    We have allready an IRC connection to the PsyBnc, now we need to send messages from IRC to ICQ, XMPP, GOOGLE TALK, MSN, YAHOO, AOI…

    Here for is a nice solution named BitlBee.
    BitlBee offers an IRC Server with can transfer message from and to nearly all instant messager protocols. By aliasing those accounts. For example you need for your system only 1 Server account at google talk, icq … and at all your supporter to the buddylist of those accounts. Now BitleBee will provide your boddylist as an irc chat.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to integrate TinyMCE or CKEditor into Django, but I have no idea
Idea: I want to make smth like real time electronic blackboard. Many users have
Any idea on how can I track users bookmarking event? I want to find
The idea of what I'm trying to do is allow a client to add
Can anyone help me with some idea on how to integrate an IVR system
Im using rails for my app and wanna integrate it with disqus, the idea
I am currently trying to integrate a live search functionality in android. I use
I do have an Idea to integrate with my application. I want to create
Idea is to integrate apache vysper to existing netty application. Is it possible to
Does anyone have an idea how to integrate JQuery UI with the ZK framework

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.