Jabber Interface Sucess

From: "Aspire" <aspire(at)mail15(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Jabber Interface Sucess
Date: 2003-07-29 13:36:45
Message-ID: 002e01c355d6$7bdd5150$31c832c0@keepaway
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Bruce and others ,

Thanks For the responce and your kind help
I have a little problem i hope you would be intrested in troubleshooting it

I am using plperl and
NET::Jabber for the postgresql connection to jabber and walah!! it realy
connects and sends messages to all the targets users.

I have created a function
pgjabber(text,text) as following
<code>
CREATE FUNCTION "public"."pgjabber" (text, text) RETURNS text AS'
#This module helps to deliver message to the jabber user
#usage pgjabber(touser(at)server,message);
use Net::Jabber qw(Client);
$toid = $_[0]; # the target uset
$body = $_[1]; # the message for that ass
my $jabconn = Net::Jabber::Client->new();
$jabconn->Connect( "hostname" => "someserver.who","port" => 5222 ) or die
"Cannot connect ($!)\\n";
my @result = $jabconn->AuthSend( "username" =>
''sender(at)some(dot)who'',"password" => "why_to_tell '',"resource" => ''work'' );
my $msg = Net::Jabber::Message->new();
$msg->SetMessage( "to"=> $toid,"subject" => "Money Deduction","body"=>
$body );
$jabconn->Send($msg);
$jabconn->Disconnect();
return sucess;
'LANGUAGE 'plperl' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
</code>
Yes the the langauge was duly created and instaled perl is 5.6.1 on RH
7.2
i386 ,gcc 3.x, Postgresql 7.3.4

Now My problem is that if i use this function pgjabber(text,text) for
sending 1 message at a time then it works
if I use this function in a loop of plpgsql function it does not
executes more than 4 times also
if i do "Select pgjabber(someplace(at)server,message); " 10 number of times as
a consecutive query it only executes and delivers message for 4 time and at
5 instance it returns the error
<error>

plperl: error from function: (in cleanup) Cannot connect ()

</error>

Would be greatful to any soul who comes to help :-)))

Regards to All readers,
Aspire .

>
>
>
>
>
>
> ----- Original Message -----
> From: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
> To: "Aspire" <aspire(at)mail15(dot)com>
> Cc: <pgsql-general(at)postgresql(dot)org>
> Sent: Saturday, July 26, 2003 02:44
> Subject: Re: [GENERAL] Jabber Interface
>
>
> >
> > You can use one of the server-side languages, like plperl, or use plsh,
> > which I think is on gborg. Either can call a shell script.
> >
>
> --------------------------------------------------------------------------
> -
> >
> > Aspire wrote:
> > > Dear all ,
> > >
> > > This could have been a wish list but ..
> > >
> > >
> > > Do any one have any idea how could one send messages to jabber server
> via
> > > postgresql i.e a trigr function that if invoked sends a message to
> specific
> > > user.
> > >
> > >
> > > Please all information provided would be apreciated
> > >
> > >
> > > Regards,
> > > V Kashyap
> > >
> > >
> > > ---------------------------(end of
broadcast)---------------------------
> > > TIP 3: if posting/reading through Usenet, please send an appropriate
> > > subscribe-nomail command to majordomo(at)postgresql(dot)org so that
your
> > > message can get through to the mailing list cleanly
> > >
> >
> > --
> > Bruce Momjian | http://candle.pha.pa.us
> > pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> > + If your life is a hard drive, | 13 Roberts Road
> > + Christ can be your backup. | Newtown Square, Pennsylvania
> 19073
> >
>

Browse pgsql-general by date

  From Date Subject
Next Message Dave [Hawk-Systems] 2003-07-29 13:41:42 determine how many matches of a string in a field
Previous Message Dima Tkach 2003-07-29 13:23:46 Re: CREATE TABLE with REFERENCE