Posted on 2005-11-28 08:57:19-08 by tschloss
Error during Auth ??
Hi, I try to user the Jabber in an "ebaywatcher" programm (see www.perlmeister.com or http://www.linux-magazine.com/issue/39/Perl_Ebay_Auction_Monitoring.pdf). I receive always the following error: Usage: Authen::SASL::Cyrus::client_new(pkg, parent, service, host, ...) at /usr/lib/perl5/vendor_perl/5.8.6/Authen/SASL.pm line 63. (No other program output at all!) I am not sure, why "Cyrus" is used, but this may be correct. Any ideas? Version problems? Thx for hints!! Thomas
#!/usr/bin/perl ########################################### # part from : ebaywatch # Mike Schilli, 2003 (m@perlmeister.com) ########################################### use warnings; #use strict; our $JABBER_ID = "xxxxx"; our $JABBER_PASSWD = "pppppp"; our $JABBER_SERVER = "jabber.i-pobox.net"; our $JABBER_PORT = 5222; use Net::Jabber qw(Client); jabber_send("Test!!!"); ########################################### sub jabber_send { ########################################### my($message) = @_; my $c = Net::Jabber::Client->new(); $c->SetCallBacks(presence => sub {}); my $status = $c->Connect( hostname => $JABBER_SERVER, port => $JABBER_PORT, ); die "Can't connect: $!" unless defined $status; my @result = $c->AuthSend( username => $JABBER_ID, password => $JABBER_PASSWD, resource => 'ebaywatcher', ); die "Can't log in: $!" unless $result[0] eq "ok"; # $c->PresenceSend(); my $m = Net::Jabber::Message->new(); my $jid = "$JABBER_ID" . '@' . "$JABBER_SERVER/GAIM"; $m->SetBody($message); $m->SetTo($jid); DEBUG "Jabber to $jid: $message"; my $rc = $c->Send($m, 1); $c->Disconnect; }
Direct Responses: 1413 | Write a response
Posted on 2005-11-28 12:28:06-08 by tschloss in response to 1412
Re: Error during Auth ??
Solved. I am not sure why, but now it works. I tried the same on a fresh SUSE10 (fresh regarding Perl and CPAN). I got some problems during install of Net::Jabber (some tests failed) and so I installed it with force. Now the programm did not run into this error anymore although id did not work anyway. So I went back a step and tried to get jabber with two normal clients running. I could not communicate between two instances of the same user with different resources!? So I registered a second user, authorized each other and tried the program with these users. And now it runs (with two different users for login and send-to). Thx The woring programm:
#!/usr/bin/perl ########################################### # excerpt from ebaywatch # Mike Schilli, 2003 (m@perlmeister.com) ########################################### use warnings; #use strict; our $JABBER_ID = 'login-user'; our $JABBER_PASSWD = "xxxxxx"; our $JABBER_SERVER = "jabber.org"; our $JABBER_PORT = 5222; our $JABBER_SENDTO = "send-to-user-name" use Net::Jabber qw(Client); print "START!"; jabber_send("Hello world!"); ########################################### sub jabber_send { ########################################### my($message) = @_; my $c = Net::Jabber::Client->new(); $c->SetCallBacks(presence => sub {}); my $status = $c->Connect( hostname => $JABBER_SERVER, port => $JABBER_PORT, ); die "Can't connect: $!" unless defined $status; my @result = $c->AuthSend( username => $JABBER_ID, password => $JABBER_PASSWD, resource => 'GAIM', ); die "Can't log in: $!" unless $result[0] eq "ok"; $c->PresenceSend(); my $m = Net::Jabber::Message->new(); my $jid = $JABBER_SENDTO . '@' . "$JABBER_SERVER/GAIM"; $m->SetBody($message); $m->SetTo($jid); print "Jabber to $jid: $message"; my $rc = $c->Send($m, 1); $c->Disconnect; }
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.