Current time: 11-23-2024, 03:05 AM Hello There, Guest! (LoginRegister)


Post Reply 
Configurable Notification via jabber
Author Message
pongraczi Offline
Junior Member
*

Posts: 80
Joined: Jul 2008
Reputation: 2
Post: #1
Configurable Notification via jabber
Hi,

It would be nice to get the possibility to change notifications from email to jabber (xmpp).

It would be a configurable option to choose email and/or jabber notification.

There is a command line tool called sendxmpp (commandline XMPP (jabber) utility).
This is a simple tool, working well.

Why? Much more comfortable and "realtime" than email. Of course, this is only my opinion.

WARNING! The sendxmpp has a "bug", which caused that, pidgin will not get the message. This is caused by that, sendxmpp send "message" as the type of the message instead of "chat". With "chat" pidgin working well.
Due to that, sendxmpp is a script, it is easy to hack to get it work.

Thanks, István
05-15-2009 01:16 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RatS Offline
Project Leader
******

Posts: 1,854
Joined: Oct 2006
Reputation: 17
Post: #2
RE: Configurable Notification via jabber
So, if you want to implement it: Try it, write a HowTo and copy it into our Documentation.

This project lives from your participation and engagement as well as from ours.
05-19-2009 06:37 AM
Visit this user's website Find all posts by this user Quote this message in a reply
pongraczi Offline
Junior Member
*

Posts: 80
Joined: Jul 2008
Reputation: 2
Post: #3
RE: Configurable Notification via jabber
(05-19-2009 06:37 AM)RatS Wrote:  So, if you want to implement it: Try it, write a HowTo and copy it into our Documentation.

This project lives from your participation and engagement as well as from ours.

You are right Smile I wrote here, because the topic was Suggestions Smile
I will try to implement it.... the success will be not guaranteed Smile
05-19-2009 07:19 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Blondak Offline
Junior Member
*****
Dev Team

Posts: 84
Joined: May 2008
Reputation: 5
Post: #4
RE: Configurable Notification via jabber
Hi,
i wrote fast patch that add notofications via XMPP protocol, patch is created over current trunk, but can be easly ported to 1.0 version, only think you must setup is add folowing lines to /etc/ispcp/ispcp.conf

Code:
XMPP_MESSAGES = 1
XMPP_SERVER = address_of_server
XMPP_PORT = 5222
XMPP_USERNAME = user_name
XMPP_DOMAIN = user_domain
XMPP_PASSWORD = user_password
XMPP_RESOURCE = user_resource
XMPP_DESTINATION = destination_address
patch sends message like this
Code:
ispCP Log

   Server: xxx.example.com (aaa.aaa.aaa.aaa)
   Version: ispCP 1.0.0 OMEGA (20090225)

   Message: ----------------[BEGIN]--------------------------

   example.com logged in.
   User IP: xxx.xxx.xxx.xxx

   Message: ----------------[END]----------------------------


Attached File(s)
.patch  XMPP-notifications.patch (Size: 59.25 KB / Downloads: 5)
(This post was last modified: 07-04-2009 12:09 AM by Blondak.)
07-03-2009 11:55 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #5
RE: Configurable Notification via jabber
This is cool Cool
Thanks a lot!

Greez BeNe
07-04-2009 12:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
pongraczi Offline
Junior Member
*

Posts: 80
Joined: Jul 2008
Reputation: 2
Post: #6
RE: Configurable Notification via jabber
Thank you very much! I will upgrade my installation and I will apply the patch and report about it.
Have a nice day!
07-04-2009 12:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ericliang Offline


Posts: 3
Joined: Aug 2009
Reputation: 0
Post: #7
RE: Configurable Notification via jabber
Best (IMO) is to use this PHP class:

http://code.google.com/p/xmpphp

and add something like

require_once('XMPPHP/Log.php');
require_once('XMPPHP/XMPP.php');

$conn = new XMPPHP_XMPP('xmpp.DOMAIN.TLD', 5222, 'USERNAME', 'PASSWORD', 'xmpphp', 'DOMAIN.TLD', $printlog=false, $loglevel=XMPPHP_Log::LEVEL_INFO);

try {
$conn->connect();
$conn->processUntil('session_start');
$conn->presence();
$conn->message('receiver@DOMAIN.TLD', "message that SHOULD BE in UTF-8" );
$conn->disconnect();
} catch(XMPPHP_Exception $e) {
echo $e->getMessage();
}

Also I assume that it would be best to have XMPP notification only for the important messages like failed attempts or server down? Don't know if this is possible, still very new with ispCP here...

But this is extremely easy to implement in native PHP (I think PHP5 is the default in ispCP, right?) and can be added in 10 minutes I think.

Eric
(This post was last modified: 09-04-2009 06:38 PM by ericliang.)
09-04-2009 06:36 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)