1Net::Jabber::Protocol(3U)ser Contributed Perl DocumentatiNoent::Jabber::Protocol(3)
2
3
4

NAME

6       Net::Jabber::Protocol - Jabber Protocol Library
7

SYNOPSIS

9         Net::Jabber::Protocol is a module that provides a developer easy
10         access to the Jabber Instant Messaging protocol.  It provides high
11         level functions to the Net::Jabber Client, Component, and Server
12         objects.  These functions are automatically indluded in those modules
13         through AUTOLOAD and delegates.
14

DESCRIPTION

16         Protocol.pm seeks to provide enough high level APIs and automation of
17         the low level APIs that writing a Jabber Client/Transport in Perl is
18         trivial.  For those that wish to work with the low level you can do
19         that too, but those functions are covered in the documentation for
20         each module.
21
22         Net::Jabber::Protocol provides functions to login, send and receive
23         messages, set personal information, create a new user account, manage
24         the roster, and disconnect.  You can use all or none of the functions,
25         there is no requirement.
26
27         For more information on how the details for how Net::Jabber is written
28         please see the help for Net::Jabber itself.
29
30         For more information on writing a Client see Net::Jabber::Client.
31
32         For more information on writing a Transport see Net::Jabber::Transport.
33
34       Modes
35
36         Several of the functions take a mode argument that let you specify how
37         the function should behave:
38
39           block - send the packet with an ID, and then block until an answer
40                   comes back.  You can optionally specify a timeout so that
41                   you do not block forever.
42
43           nonblock - send the packet with an ID, but then return that id and
44                      control to the master program.  Net::Jabber is still
45                      tracking this packet, so you must use the CheckID function
46                      to tell when it comes in.  (This might not be very
47                      useful...)
48
49           passthru - send the packet with an ID, but do NOT register it with
50                      Net::Jabber, then return the ID.  This is useful when
51                      combined with the XPath function because you can register
52                      a one shot function tied to the id you get back.
53
54       Basic Functions
55
56           use Net::Jabber qw( Client );
57           $Con = new Net::Jabber::Client();                # From
58           $status = $Con->Connect(hostname=>"jabber.org"); # Net::Jabber::Client
59
60             or
61
62           use Net::Jabber qw( Component );
63           $Con = new Net::Jabber::Component();             #
64           $status = $Con->Connect(hostname=>"jabber.org",  # From
65                                   secret=>"bob");          # Net::Jabber::Component
66
67           #
68           # For callback setup, see Net::XMPP::Protocol
69           #
70
71           $Con->Info(name=>"Jarl",
72                      version=>"v0.6000");
73
74       ID Functions
75
76           $id         = $Con->SendWithID($sendObj);
77           $id         = $Con->SendWithID("<tag>XML</tag>");
78           $receiveObj = $Con->SendAndReceiveWithID($sendObj);
79           $receiveObj = $Con->SendAndReceiveWithID($sendObj,
80                                                    10);
81           $receiveObj = $Con->SendAndReceiveWithID("<tag>XML</tag>");
82           $receiveObj = $Con->SendAndReceiveWithID("<tag>XML</tag>",
83                                                    5);
84           $yesno      = $Con->ReceivedID($id);
85           $receiveObj = $Con->GetID($id);
86           $receiveObj = $Con->WaitForID($id);
87           $receiveObj = $Con->WaitForID($id,
88                                         20);
89
90       IQ  Functions
91
92       Agents Functions
93
94           %agents = $Con->AgentsGet();
95           %agents = $Con->AgentsGet(to=>"transport.jabber.org");
96
97       Browse Functions
98
99           %hash = $Con->BrowseRequest(jid=>"jabber.org");
100           %hash = $Con->BrowseRequest(jid=>"jabber.org",
101                                       timeout=>10);
102
103           $id = $Con->BrowseRequest(jid=>"jabber.org",
104                                     mode=>"nonblock");
105
106           $id = $Con->BrowseRequest(jid=>"jabber.org",
107                                     mode=>"passthru");
108
109       Browse DB Functions
110
111           $Con->BrowseDBDelete("jabber.org");
112           $Con->BrowseDBDelete(Net::Jabber::JID);
113
114           $presence  = $Con->BrowseDBQuery(jid=>"bob\@jabber.org");
115           $presence  = $Con->BrowseDBQuery(jid=>Net::Jabber::JID);
116           $presence  = $Con->BrowseDBQuery(jid=>"users.jabber.org",
117                                            timeout=>10);
118           $presence  = $Con->BrowseDBQuery(jid=>"conference.jabber.org",
119                                            refresh=>1);
120
121       Bystreams Functions
122
123           %hash = $Con->ByteStreamsProxyRequest(jid=>"proxy.server");
124           %hash = $Con->ByteStreamsProxyRequest(jid=>"proxy.server",
125                                                 timeout=>10);
126
127           $id = $Con->ByteStreamsProxyRequest(jid=>"proxy.server",
128                                               mode=>"nonblock");
129
130           $id = $Con->ByteStreamsProxyRequest(jid=>"proxy.server",
131                                               mode=>"passthru");
132
133           %hash = $Con->ByteStreamsProxyParse($query);
134
135           $status = $Con->ByteStreamsProxyActivate(sid=>"stream_id",
136                                                    jid=>"proxy.server");
137           $status = $Con->ByteStreamsProxyActivate(sid=>"stream_id",
138                                                    jid=>"proxy.server",
139                                                   timeout=>10);
140
141           $id = $Con->ByteStreamsProxyActivate(sid=>"stream_id",
142                                                jid=>"proxy.server",
143                                               mode=>"nonblock");
144
145           $id = $Con->ByteStreamsProxyActivate(sid=>"stream_id",
146                                                jid=>"proxy.server",
147                                               mode=>"passthru");
148
149           $jid = $Con->ByteStreamsOffer(sid=>"stream_id",
150                                         streamhosts=>[{jid=>"jid",
151                                                        host=>"host",
152                                                        port=>"port",
153                                                        zeroconf=>"zero",
154                                                       },
155                                                       ...
156                                                      ],
157                                         jid=>"bob\@jabber.org");
158           $jid = $Con->ByteStreamsOffer(sid=>"stream_id",
159                                         streamhosts=>[{},{},...],
160                                         jid=>"bob\@jabber.org",
161                                         timeout=>10);
162
163           $id = $Con->ByteStreamsOffer(sid=>"stream_id",
164                                        streamhosts=>[{},{},...],
165                                        jid=>"bob\@jabber.org",
166                                        mode=>"nonblock");
167
168           $id = $Con->ByteStreamsOffer(sid=>"stream_id",
169                                        streamhosts=>[{},{},...],
170                                        jid=>"bob\@jabber.org",
171                                        mode=>"passthru");
172
173       Disco Functions
174
175           %hash = $Con->DiscoInfoRequest(jid=>"jabber.org");
176           %hash = $Con->DiscoInfoRequest(jid=>"jabber.org",
177                                          node=>"node...");
178           %hash = $Con->DiscoInfoRequest(jid=>"jabber.org",
179                                          node=>"node...",
180                                          timeout=>10);
181
182           $id = $Con->DiscoInfoRequest(jid=>"jabber.org",
183                                        mode=>"nonblock");
184           $id = $Con->DiscoInfoRequest(jid=>"jabber.org",
185                                        node=>"node...",
186                                        mode=>"nonblock");
187
188           $id = $Con->DiscoInfoRequest(jid=>"jabber.org",
189                                        mode=>"passthru");
190           $id = $Con->DiscoInfoRequest(jid=>"jabber.org",
191                                        node=>"node...",
192                                        mode=>"passthru");
193
194           %hash = $Con->DiscoInfoParse($query);
195
196           %hash = $Con->DiscoItemsRequest(jid=>"jabber.org");
197           %hash = $Con->DiscoItemsRequest(jid=>"jabber.org",
198                                           timeout=>10);
199
200           $id = $Con->DiscoItemsRequest(jid=>"jabber.org",
201                                         mode=>"nonblock");
202
203           $id = $Con->DiscoItemsRequest(jid=>"jabber.org",
204                                         mode=>"passthru");
205
206           %hash = $Con->DiscoItemsParse($query);
207
208       Feature Negotiation Functions
209
210           %hash = $Con->FeatureNegRequest(jid=>"jabber.org",
211                                           features=>{ feat1=>["opt1","opt2",...],
212                                                       feat2=>["optA","optB",...]
213                                                     }
214                                          );
215           %hash = $Con->FeatureNegRequest(jid=>"jabber.org",
216                                           features=>{ ... },
217                                           timeout=>10);
218
219           $id = $Con->FeatureNegRequest(jid=>"jabber.org",
220                                         features=>{ ... },
221                                         mode=>"nonblock");
222
223           $id = $Con->FeatureNegRequest(jid=>"jabber.org",
224                                         features=>{ ... },
225                                         mode=>"passthru");
226
227           my $query = $self->FeatureNegQuery(\{ ... });
228           $iq->AddQuery($query);
229
230           %hash = $Con->FeatureNegParse($query);
231
232       File Transfer Functions
233
234           $method = $Con->FileTransferOffer(jid=>"bob\@jabber.org",
235                                             sid=>"stream_id",
236                                             filename=>"/path/to/file",
237                                             methods=>["http://jabber.org/protocol/si/profile/bytestreams",
238                                                       "jabber:iq:oob",
239                                                       ...
240                                                      ]
241                                            );
242           $method = $Con->FileTransferOffer(jid=>"bob\@jabber.org",
243                                             sid=>"stream_id",
244                                             filename=>"/path/to/file",
245                                             methods=>\@methods,
246                                             timeout=>"10");
247
248           $id = $Con->FileTransferOffer(jid=>"bob\@jabber.org",
249                                         sid=>"stream_id",
250                                         filename=>"/path/to/file",
251                                         methods=>\@methods,
252                                         mode=>"nonblock");
253
254           $id = $Con->FileTransferOffer(jid=>"bob\@jabber.org",
255                                         sid=>"stream_id",
256                                         filename=>"/path/to/file",
257                                         methods=>\@methods,
258                                         mode=>"passthru");
259
260       Last Functions
261
262           $Con->LastQuery();
263           $Con->LastQuery(to=>"bob@jabber.org");
264
265           %result = $Con->LastQuery(mode=>"block");
266           %result = $Con->LastQuery(to=>"bob@jabber.org",
267                                     mode=>"block");
268
269           %result = $Con->LastQuery(to=>"bob@jabber.org",
270                                     mode=>"block",
271                                     timeout=>10);
272           %result = $Con->LastQuery(mode=>"block",
273                                     timeout=>10);
274
275           $Con->LastSend(to=>"bob@jabber.org");
276
277           $seconds = $Con->LastActivity();
278
279       Multi-User Chat Functions
280
281           $Con->MUCJoin(room=>"jabber",
282                         server=>"conference.jabber.org",
283                         nick=>"nick");
284
285           $Con->MUCJoin(room=>"jabber",
286                         server=>"conference.jabber.org",
287                         nick=>"nick",
288                         password=>"secret");
289
290       Register Functions
291
292           @result = $Con->RegisterSendData("users.jabber.org",
293                                            first=>"Bob",
294                                            last=>"Smith",
295                                            nick=>"bob",
296                                            email=>"foo@bar.net");
297
298       RPC Functions
299
300           $query = $Con->RPCEncode(type=>"methodCall",
301                                    methodName=>"methodName",
302                                    params=>[param,param,...]);
303           $query = $Con->RPCEncode(type=>"methodResponse",
304                                    params=>[param,param,...]);
305           $query = $Con->RPCEncode(type=>"methodResponse",
306                                    faultCode=>4,
307                                    faultString=>"Too many params");
308
309           @response = $Con->RPCParse($iq);
310
311           @response = $Con->RPCCall(to=>"dataHouse.jabber.org",
312                                     methodname=>"numUsers",
313                                     params=>[ param,param,... ]
314                                    );
315
316           $Con->RPCResponse(to=>"you\@jabber.org",
317                             params=>[ param,param,... ]);
318
319           $Con->RPCResponse(to=>"you\@jabber.org",
320                             faultCode=>"4",
321                             faultString=>"Too many parameters"
322                            );
323
324           $Con->RPCSetCallBacks(myMethodA=>\&methoda,
325                                 myMethodB=>\&do_somthing,
326                                 etc...
327                                );
328
329       Search Functions
330
331           %fields = $Con->SearchRequest();
332           %fields = $Con->SearchRequest(to=>"users.jabber.org");
333           %fields = $Con->SearchRequest(to=>"users.jabber.org",
334                                         timeout=>10);
335
336           $Con->SearchSend(to=>"somewhere",
337                            name=>"",
338                            first=>"Bob",
339                            last=>"",
340                            nick=>"bob",
341                            email=>"",
342                            key=>"some key");
343
344           $Con->SearchSendData("users.jabber.org",
345                                first=>"Bob",
346                                last=>"",
347                                nick=>"bob",
348                                email=>"");
349
350       Time Functions
351
352           $Con->TimeQuery();
353           $Con->TimeQuery(to=>"bob@jabber.org");
354
355           %result = $Con->TimeQuery(mode=>"block");
356           %result = $Con->TimeQuery(to=>"bob@jabber.org",
357                                     mode=>"block");
358
359           $Con->TimeSend(to=>"bob@jabber.org");
360
361       Version Functions
362
363           $Con->VersionQuery();
364           $Con->VersionQuery(to=>"bob@jabber.org");
365
366           %result = $Con->VersionQuery(mode=>"block");
367           %result = $Con->VersionQuery(to=>"bob@jabber.org",
368                                        mode=>"block");
369
370           $Con->VersionSend(to=>"bob@jabber.org",
371                             name=>"Net::Jabber",
372                             ver=>"1.0a",
373                             os=>"Perl");
374

METHODS

376       Basic Functions
377
378           Info(name=>string,    - Set some information so that Net::Jabber
379                version=>string)   can auto-reply to some packets for you to
380                                   reduce the work you have to do.
381
382                                   NOTE: This requires that you use the
383                                   SetIQCallBacks methodology and not the
384                                   SetCallBacks for <iq/> packets.
385
386       IQ Functions
387
388       Agents Functions
389
390           ********************************
391           *                              *
392           * Deprecated in favor of Disco *
393           *                              *
394           ********************************
395
396           AgentsGet(to=>string, - takes all of the information and
397           AgentsGet()             builds a Net::Jabber::IQ::Agents packet.
398                                   It then sends that packet either to the
399                                   server, or to the specified transport,
400                                   with an ID and waits for that ID to return.
401                                   Then it looks in the resulting packet and
402                                   builds a hash that contains the values
403                                   of the agent list.  The hash is layed out
404                                   like this:  (NOTE: the jid is the key to
405                                   distinguish the various agents)
406
407                                     $hash{<JID>}->{order} = 4
408                                                 ->{name} = "ICQ Transport"
409                                                 ->{transport} = "ICQ #"
410                                                 ->{description} = "ICQ..blah.."
411                                                 ->{service} = "icq"
412                                                 ->{register} = 1
413                                                 ->{search} = 1
414                                               etc...
415
416                                   The order field determines the order that
417                                   it came from the server in... in case you
418                                   care.  For more info on the valid fields
419                                   see the Net::Jabber::Query jabber:iq:agent
420                                   namespace.
421
422       Browse Functions
423
424           ********************************
425           *                              *
426           * Deprecated in favor of Disco *
427           *                              *
428           ********************************
429
430           BrowseRequest(jid=>string, - sends a jabber:iq:browse request to
431                         mode=>string,  the jid passed as an argument.
432                         timeout=>int)  Returns a hash with the resulting
433                                        tree if mode is set to "block":
434
435                       $browse{'category'} = "conference"
436                       $browse{'children'}->[0]
437                       $browse{'children'}->[1]
438                       $browse{'children'}->[11]
439                       $browse{'jid'} = "conference.jabber.org"
440                       $browse{'name'} = "Jabber.org Conferencing Center"
441                       $browse{'ns'}->[0]
442                       $browse{'ns'}->[1]
443                       $browse{'type'} = "public"
444
445                                        The ns array is an array of the
446                                        namespaces that this jid supports.
447                                        The children array points to hashs
448                                        of this form, and represent the fact
449                                        that they can be browsed to.
450
451                                        See MODES above for using the mode
452                                        and timeout.
453
454       Browse DB Functions
455
456           BrowseDBDelete(string⎪Net::Jabber::JID) - delete thes JID browse
457                                                     data from the DB.
458
459           BrowseDBQuery(jid=>string ⎪ NJ::JID, - returns the browse data
460                         timeout=>integer,        for the requested JID.  If
461                         refresh=>0⎪1)            the DB does not contain
462                                                  the data for the JID, then
463                                                  it attempts to fetch the
464                                                  data via BrowseRequest().
465                                                  The timeout is passed to
466                                                  the BrowseRequest() call,
467                                                  and refresh tells the DB
468                                                  to request the data, even
469                                                  if it already has some.
470
471       Bytestreams Functions
472
473           ByteStreamsProxyRequest(jid=>string, - sends a bytestreams request
474                                   mode=>string,  to the jid passed as an
475                                   timeout=>int)  argument.  Returns an array
476                                                  ref with the resulting tree
477                                                  if mode is set to "block".
478
479                                                  See ByteStreamsProxyParse
480                                                  for the format of the
481                                                  resulting tree.
482
483                                                  See MODES above for using
484                                                  the mode and timeout.
485
486           ByteStreamsProxyParse(Net::Jabber::Query) - parses the query and
487                                                       returns an array ref
488                                                       to the resulting tree:
489
490                       $host[0]->{jid} = "bytestreams1.proxy.server";
491                       $host[0]->{host} = "proxy1.server";
492                       $host[0]->{port} = "5006";
493                       $host[1]->{jid} = "bytestreams2.proxy.server";
494                       $host[1]->{host} = "proxy2.server";
495                       $host[1]->{port} = "5007";
496                       ...
497
498           ByteStreamsProxyActivate(jid=>string, - sends a bytestreams activate
499                                    sid=>string,   to the jid passed as an
500                                    mode=>string,  argument.  Returns 1 if the
501                                    timeout=>int)  proxy activated (undef if
502                                                   it did not) if mode is set
503                                                   to "block".
504
505                                                   sid is the stream id that
506                                                   is being used to talk about
507                                                   this stream.
508
509                                                   See MODES above for using
510                                                   the mode and timeout.
511
512           ByteStreamsOffer(jid=>string,         - sends a bytestreams offer
513                            sid=>string,           to the jid passed as an
514                            streamhosts=>arrayref  argument.  Returns the jid
515                            mode=>string,          of the streamhost that the
516                            timeout=>int)          user selected if mode is set
517                                                   to "block".
518
519                                                   streamhosts is the same
520                                                   format as the array ref
521                                                   returned from
522                                                   ByteStreamsProxyParse.
523
524                                                   See MODES above for using
525                                                   the mode and timeout.
526
527       Disco Functions
528
529           DiscoInfoRequest(jid=>string, - sends a disco#info request to
530                            node=>string,  the jid passed as an argument,
531                            mode=>string,  and the node if specified.
532                            timeout=>int)  Returns a hash with the resulting
533                                           tree if mode is set to "block".
534
535                                           See DiscoInfoParse for the format
536                                           of the resulting tree.
537
538                                           See MODES above for using the mode
539                                           and timeout.
540
541           DiscoInfoParse(Net::Jabber::Query) - parses the query and
542                                                returns a hash ref
543                                                to the resulting tree:
544
545                    $info{identity}->[0]->{category} = "groupchat";
546                    $info{identity}->[0]->{name} = "Public Chatrooms";
547                    $info{identity}->[0]->{type} = "public";
548
549                    $info{identity}->[1]->{category} = "groupchat";
550                    $info{identity}->[1]->{name} = "Private Chatrooms";
551                    $info{identity}->[1]->{type} = "private";
552
553                    $info{feature}->{http://jabber.org/protocol/disco#info} = 1;
554                    $info{feature}->{http://jabber.org/protocol/muc#admin} = 1;
555
556           DiscoItemsRequest(jid=>string, - sends a disco#items request to
557                             mode=>string,  the jid passed as an argument.
558                             timeout=>int)  Returns a hash with the resulting
559                                            tree if mode is set to "block".
560
561                                            See DiscoItemsParse for the format
562                                            of the resulting tree.
563
564                                            See MODES above for using the mode
565                                            and timeout.
566
567           DiscoItemsParse(Net::Jabber::Query) - parses the query and
568                                                 returns a hash ref
569                                                 to the resulting tree:
570
571                    $items{jid}->{node} = name;
572
573                    $items{"proxy.server"}->{""} = "Bytestream Proxy Server";
574                    $items{"conf.server"}->{"public"} = "Public Chatrooms";
575                    $items{"conf.server"}->{"private"} = "Private Chatrooms";
576
577       Feature Negotiation Functions
578
579           FeatureNegRequest(jid=>string,       - sends a feature negotiation to
580                             features=>hash ref,  the jid passed as an argument,
581                             mode=>string,        using the features specified.
582                             timeout=>int)        Returns a hash with the resulting
583                                                  tree if mode is set to "block".
584
585                                                  See DiscoInfoQuery for the format
586                                                  of the features hash ref.
587
588                                                  See DiscoInfoParse for the format
589                                                  of the resulting tree.
590
591                                                  See MODES above for using the mode
592                                                  and timeout.
593
594           FeatureNegParse(Net::Jabber::Query) - parses the query and
595                                                 returns a hash ref
596                                                 to the resulting tree:
597
598                    $features->{feat1} = ["opt1","opt2",...];
599                    $features->{feat2} = ["optA","optB",...];
600                    ....
601
602                                                 If this is a result:
603
604                    $features->{feat1} = "opt2";
605                    $features->{feat2} = "optA";
606                    ....
607
608           FeatureNeqQuery(hash ref) - takes a hash ref and turns it into a
609                                       feature negotiation query that you can
610                                       AddQuery into your packaet.  The format
611                                       of the hash ref is as follows:
612
613                    $features->{feat1} = ["opt1","opt2",...];
614                    $features->{feat2} = ["optA","optB",...];
615                    ....
616
617       File Transfer Functions
618
619           FileTransferOffer(jid=>string,         - sends a file transfer stream
620                             sid=>string,           initiation to the jid passed
621                             filename=>string,      as an argument.  Returns the
622                             mode=>string,          method (if the users accepts),
623                             timeout=>int)          undef (if the user declines),
624                                                    if the mode is set to "block".
625
626                                                    See MODES above for using
627                                                    the mode and timeout.
628
629       Last Functions
630
631           LastQuery(to=>string,     - asks the jid specified for its last
632                     mode=>string,     activity.  If the to is blank, then it
633                     timeout=>int)     queries the server.  Returns a hash with
634           LastQuery()                 the various items set if mode is set to
635                                       "block":
636
637                                         $last{seconds} - Seconds since activity
638                                         $last{message} - Message for activity
639
640                                       See MODES above for using the mode
641                                       and timeout.
642
643           LastSend(to=>string, - sends the specified last to the specified jid.
644                    hash)         the hash is the seconds and message as shown
645                                  in the Net::Jabber::Query man page.
646
647           LastActivity() - returns the number of seconds since the last activity
648                            by the user.
649
650       Multi-User Chat Functions
651
652           MUCJoin(room=>string,    - Sends the appropriate MUC protocol to join
653                   server=>string,    the specified room with the specified nick.
654                   nick=>string,
655                   password=>string)
656
657       Register Functions
658
659           RegisterSendData(string⎪JID, - takes the contents of the hash and
660                            hash)         builds a jabebr:x:data return packet
661                                          which it sends in a Net::Jabber::Query
662                                          jabber:iq:register namespace packet.
663                                          The first argument is the JID to send
664                                          the packet to.  This function returns
665                                          an array that looks like this:
666
667                                            [ type , message ]
668
669                                          If type is "ok" then registration was
670                                          successful, otherwise message contains
671                                          a little more detail about the error.
672
673       RPC Functions
674
675           RPCParse(IQ object) - returns an array.  The first argument tells
676                                 the status "ok" or "fault".  The second
677                                 argument is an array if "ok", or a hash if
678                                 "fault".
679
680           RPCCall(to=>jid⎪string,     - takes the methodName and params,
681                   methodName=>string,   builds the RPC calls and sends it
682                   params=>array,        to the specified address.  Returns
683                   mode=>string,         the above data from RPCParse.
684                   timeout=>int)
685                                         See MODES above for using the mode
686                                         and timeout.
687
688           RPCResponse(to=>jid⎪string,      - generates a response back to
689                       params=>array,         the caller.  If any part of
690                       faultCode=>int,        fault is specified, then it
691                       faultString=>string)   wins.
692
693           Note: To ensure that you get the correct type for a param sent
694                 back, you can specify the type by prepending the type to
695                 the value:
696
697                   "i4:5" or "int:5"
698                   "boolean:0"
699                   "string:56"
700                   "double:5.0"
701                   "datetime:20020415T11:11:11"
702                   "base64:...."
703
704           RPCSetCallBacks(method=>function, - sets the callback functions
705                           method=>function,   for the specified methods.
706                           etc...)             The method comes from the
707                                               <methodName/> and is case
708                                               sensitive.  The single
709                                               arguemnt is a ref to an
710                                               array that contains the
711                                               <params/>.  The function you
712                                               write should return one of two
713                                               things:
714
715                                                 ["ok", [...] ]
716
717                                               The [...] is a list of the
718                                               <params/> you want to return.
719
720                                                 ["fault", {faultCode=>1,
721                                                            faultString=>...} ]
722
723                                               If you set the function to undef,
724                                               then the method is removed from
725                                               the list.
726
727       Search Functions
728
729           SearchRequest(to=>string,  - send an <iq/> request to the specified
730                         mode=>string,  server/transport, if not specified it
731                         timeout=>int)  sends to the current active server.
732           SearchRequest()              The function returns a hash that
733                                        contains the required fields.   Here
734                                        is an example of the hash:
735
736                                        $hash{fields}    - The raw fields from
737                                                           the iq:register.  To
738                                                           be used if there is
739                                                           no x:data in the
740                                                           packet.
741                                        $hash{instructions} - How to fill out
742                                                              the form.
743                                        $hash{form}   - The new dynamic forms.
744
745                                        In $hash{form}, the fields that are
746                                        present are the required fields the
747                                        server needs.
748
749                                        See MODES above for using the mode
750                                        and timeout.
751
752           SearchSend(to=>string⎪JID, - takes the contents of the hash and
753                      hash)             passes it to the SetSearch function
754                                        in the Net::Jabber::Query
755                                        jabber:iq:search namespace.  And then
756                                        sends the packet.
757
758           SearchSendData(string⎪JID, - takes the contents of the hash and
759                          hash)         builds a jabebr:x:data return packet
760                                        which it sends in a Net::Jabber::Query
761                                        jabber:iq:search namespace packet.
762                                        The first argument is the JID to send
763                                        the packet to.
764
765       Time Functions
766
767           TimeQuery(to=>string,     - asks the jid specified for its localtime.
768                     mode=>string,     If the to is blank, then it queries the
769                     timeout=>int)     server.  Returns a hash with the various
770           TimeQuery()                 items set if mode is set to "block":
771
772                                         $time{utc}     - Time in UTC
773                                         $time{tz}      - Timezone
774                                         $time{display} - Display string
775
776                                       See MODES above for using the mode
777                                       and timeout.
778
779           TimeSend(to=>string) - sends the current UTC time to the specified
780                                  jid.
781
782       Version Functions
783
784           VersionQuery(to=>string,     - asks the jid specified for its
785                        mode=>string,     client version information.  If the
786                        timeout=>int)     to is blank, then it queries the
787           VersionQuery()                 server.  Returns ahash with the
788                                          various items set if mode is set to
789                                          "block":
790
791                                            $version{name} - Name
792                                            $version{ver}  - Version
793                                            $version{os}   - Operating System/
794                                                               Platform
795
796                                         See MODES above for using the mode
797                                         and timeout.
798
799           VersionSend(to=>string,   - sends the specified version information
800                       name=>string,   to the jid specified in the to.
801                       ver=>string,
802                       os=>string)
803

AUTHOR

805       Ryan Eatmon
806
808       This module is free software; you can redistribute it and/or modify it
809       under the same terms as Perl itself.
810
811
812
813perl v5.8.8                       2004-08-16          Net::Jabber::Protocol(3)
Impressum