.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::SNPP 3pm" .TH Net::SNPP 3pm "2008-02-04" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Net::SNPP \- Simple Network Pager Protocol Client .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::SNPP; .Ve .PP .Vb 3 \& # Constructors \& $snpp = Net::SNPP\->new(\(aqsnpphost\(aq); \& $snpp = Net::SNPP\->new(\(aqsnpphost\(aq, Timeout => 60); .Ve .SH "NOTE" .IX Header "NOTE" This module is in a maintenance mode, as I no longer have significant access to \s-1SNPP\s0 servers to test with. However, to the best of the present maintainer's knowledge, the module works just fine and has been used in many a production environment. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module implements a client interface to the \s-1SNPP\s0 protocol, enabling a perl5 application to talk to \s-1SNPP\s0 servers. This documentation assumes that you are familiar with the \s-1SNPP\s0 protocol described in \s-1RFC1861\s0. .PP A new Net::SNPP object must be created with the \fInew\fR method. Once this has been done, all \s-1SNPP\s0 commands are accessed through this object. .SH "EXAMPLES" .IX Header "EXAMPLES" This example will send a pager message in one hour saying \*(L"Your lunch is ready\*(R" .PP .Vb 1 \& #!/usr/local/bin/perl \-w .Ve .PP .Vb 1 \& use Net::SNPP; .Ve .PP .Vb 1 \& $snpp = Net::SNPP\->new(\(aqsnpphost\(aq); .Ve .PP .Vb 5 \& $snpp\->send( Pager => $some_pager_number, \& Message => "Your lunch is ready", \& Alert => 1, \& Hold => time + 3600, # lunch ready in 1 hour :\-) \& ) || die $snpp\->message; .Ve .PP .Vb 1 \& $snpp\->quit; .Ve .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .IP "new ( [ \s-1HOST\s0, ] [ \s-1OPTIONS\s0 ] )" 4 .IX Item "new ( [ HOST, ] [ OPTIONS ] )" This is the constructor for a new Net::SNPP object. \f(CW\*(C`HOST\*(C'\fR is the name of the remote host to which a \s-1SNPP\s0 connection is required. .Sp If \f(CW\*(C`HOST\*(C'\fR is not given, then the \f(CW\*(C`SNPP_Host\*(C'\fR specified in \f(CW\*(C`Net::Config\*(C'\fR will be used. .Sp \&\f(CW\*(C`OPTIONS\*(C'\fR are passed in a hash like fashion, using key and value pairs. Possible options are: .Sp \&\fBTimeout\fR \- Maximum time, in seconds, to wait for a response from the \&\s-1SNPP\s0 server (default: 120) .Sp \&\fBDebug\fR \- Enable debugging information .Sp Example: .Sp .Vb 3 \& $snpp = Net::SNPP\->new(\(aqsnpphost\(aq, \& Debug => 1, \& ); .Ve .SH "METHODS" .IX Header "METHODS" Unless otherwise stated all methods return either a \fItrue\fR or \fIfalse\fR value, with \fItrue\fR meaning that the operation was a success. When a method states that it returns a value, failure will be returned as \fIundef\fR or an empty list. .IP "reset ()" 4 .IX Item "reset ()" .PD 0 .IP "help ()" 4 .IX Item "help ()" .PD Request help text from the server. Returns the text or undef upon failure .IP "quit ()" 4 .IX Item "quit ()" Send the \s-1QUIT\s0 command to the remote \s-1SNPP\s0 server and close the socket connection. .IP "site ( \s-1CMD\s0 )" 4 .IX Item "site ( CMD )" Send a \s-1SITE\s0 command to the remote \s-1SNPP\s0 server. \fIsite()\fR take a single argument which is the command string to send to the \s-1SNPP\s0 server. .IP "ping ( \s-1PAGER_ID\s0 )" 4 .IX Item "ping ( PAGER_ID )" Determine if the remote \s-1SNPP\s0 server is able to contact a given pager \s-1ID\s0. (Level 3 command) .IP "noqueue ()" 4 .IX Item "noqueue ()" Instruct the \s-1SNPP\s0 server not to queue the two-way request. (Level 3 command) .IP "expire_time ( \s-1HOURS\s0 )" 4 .IX Item "expire_time ( HOURS )" Cause the paging request to be canceled if it has not been sent in the specified number of hours. (Level 3 command) .IP "read_ack ( \s-1TRUEFALSE\s0 )" 4 .IX Item "read_ack ( TRUEFALSE )" Enable and disable the read acknowledgement notification sent by the pager. (Level 3 command) .IP "reply_type ( \s-1TYPE_CODE\s0 )" 4 .IX Item "reply_type ( TYPE_CODE )" Change the type of reply that the page will send back. Valid options are: \&\s-1NONE\s0, \s-1YESNO\s0, \s-1SIMREPLY\s0, \s-1MULTICHOICE\s0, and \s-1TEXT\s0. (Level 3 command) .IP "message_response ( \s-1INT\s0 \s-1TEXT\s0 ) (Level 3)" 4 .IX Item "message_response ( INT TEXT ) (Level 3)" Create message responses to deliver with the message. \s-1INT\s0 is a 2\-byte number. The total number of definable responses may be limited by your server. Some server may need you to call \fIreply_type()\fR before specifying responses. .IP "message_status ( \s-1MSGID\s0 \s-1MSGID\s0 ) (Level 3)" 4 .IX Item "message_status ( MSGID MSGID ) (Level 3)" Get the message status from the remote server. Use the Message_Tag and Pass_Code from \fIsend_two_way()\fR as the arguments to this method, and if your server supports it, you should be able to retrieve the status of a 2\-way message. An array/arraref is returned with the following 5 elements: [0] Sequence [1] Date&Time [2] +/\- \s-1GMT\s0 (if provided by server) [3] server-specific response text [4] numeric response code from server (i.e. 860 or 960) .IP "send_two_way () (Level 3)" 4 .IX Item "send_two_way () (Level 3)" Use this method instead of \fIsend()\fR when working in Level 3 of the \s-1SNPP\s0 protocol. Before using this method, you have to build up your page using the other methods in the module, then use this at the very end to \*(L"submit\*(R" your page. An array/arrayref will be returned with the following 4 elements: [0] Message_Tag [1] Pass_Code [2] server-specific response text [3] numeric response code from server (i.e. 860 or 960) .Sp \&\s-1NOTE:\s0 This is only the \s-1SEND\s0 command \- you have to build the page using various methods from this module before calling this method. .SH "2WAY EXAMPLES" .IX Header "2WAY EXAMPLES" .Vb 1 \& use Net::SNPP; .Ve .PP .Vb 10 \& my $snpp = Net::SNPP\->new( "snpp.provider.com" ); \& $snpp\->two_way(); \& $snpp\->pager_id( 5555555555 ); \& $snpp\->data( "The sky is falling!\enThe sky is falling!" ); \& $snpp\->message_response( 1, "Don\(aqt Panic" ); \& $snpp\->message_response( 2, "Panic!" ); \& my @result = $snpp\->send_two_way(); \& $snpp\->quit(); \& printf "Use these two numbers: \e"%s %s\e" to check message status.\en", \& $result[0], $result[1]; .Ve .PP .Vb 1 \& __END__ .Ve .PP .Vb 1 \& use Net::SNPP; .Ve .PP .Vb 3 \& my $snpp = Net::SNPP\->new( "snpp.provider.com" ); \& my @status = $snpp\->message_status( $ARGV[0], $ARGV[1] ); \& $snpp\->quit; .Ve .PP .Vb 1 \& printf "User responded with: %s\en", $status[3]; .Ve .SH "EXPORTS" .IX Header "EXPORTS" \&\f(CW\*(C`Net::SNPP\*(C'\fR exports all that \f(CW\*(C`Net::CMD\*(C'\fR exports, plus three more subroutines that can bu used to compare against the result of \f(CW\*(C`status\*(C'\fR. These are :\- \&\f(CW\*(C`CMD_2WAYERROR\*(C'\fR, \f(CW\*(C`CMD_2WAYOK\*(C'\fR, and \f(CW\*(C`CMD_2WAYQUEUED\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" Net::Cmd \&\s-1RFC1861\s0 .SH "AUTHOR" .IX Header "AUTHOR" Derek J. Balling ( original version by Graham Barr ) Al Tobey (since Oct 2003) .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 1995\-2001 Graham Barr. (c) 2001\-2003 Derek J. Balling. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP \&\fI$Id: \s-1SNPP\s0.pm,v 1.9 2004/01/27 22:18:32 tobeya Exp $\fR