Re: Jabber Interface

From: "Aspire" <aspire(at)mail15(dot)com>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Jabber Interface
Date: 2003-07-28 14:00:09
Message-ID: 001301c35510$95aee290$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
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-07-28 14:11:52 Re: 7.3.3 array_out tweak
Previous Message nolan 2003-07-28 13:46:50 Re: psql -e