Hello Martin

I use some code of jabber_alert.pl and simplify so we can be notify when a
new ticket was created.

The code is very simple and you can modify for future release of OTRS

We need the Net::Jabber library and I’m testing with Wildfire Jabber Server
3.01 with SSL

After install Net::Jabber you need to change a line in Protocol.pm (this is
because of Wildfire)

http://www.jivesoftware.org/community/message.jspa?messageID=123678

This is a known problem.

At the moment the best you can do is comment out line 1772 in
Net/XMPP/Protocol.pm.

The line:
return $self->AuthSASL(%args);
becomes
# return $self->AuthSASL(%args);

Not pretty but it works.

After this, just edit Kernel/System/Ticket/Article.pm and add this lines in
the beginning

## Jabber
use Net::Jabber qw(Client) ;
use Net::Jabber qw(Message) ;   
use Net::Jabber qw(Protocol) ;
use Net::Jabber qw(Presence) ;

use vars qw ($connection @result $message);

and this code after the #send notify and before “write History 

# Connect and Jab message
# must have attention to server name and port. Because I use SSL, the port
is 5223. The usual port is 5222

$connection = Net::Jabber::Client->new();
$connection->Connect( "hostname" => "[your server]","port" => '5223', "ssl"
=> "1" )  or die
"Cannot connect to hostname\n";

@result = $connection->AuthSend( "username" => "[user to open the
connection]","password" =>
"[password]","resource" => "DaemonMonitor", "ssl" => "1" );

if ($result[0] ne "ok") {
 die "Ident/Auth with server failed: $result[0] - $result[1]\n";
}

$message = Net::Jabber::Message->new();
$message->SetMessage( "to"           => $User{UserEmail},
                      "subject"      => "Ticket OTRS Alert",
                      "type"         => "normal",
                      "body"         => $Notification{Body},
                       "ssl"         => "1");

$connection->Send($message);
$connection->Disconnect();


## End

I think that you can “clean” the code and make a good integration with
Jabber for notify agent and possible the customer

Regards

Filipe Henriques




_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Reply via email to