.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .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" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::SNPP 3pm" .TH Net::SNPP 3pm "2022-10-13" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::SNPP \- Simple Network Pager Protocol Client .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::SNPP; \& \& # 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 \& \& use Net::SNPP; \& \& $snpp = Net::SNPP\->new(\*(Aqsnpphost\*(Aq); \& \& $snpp\->send( Pager => $some_pager_number, \& Message => "Your lunch is ready", \& Alert => 1, \& Hold => time + 3600, # lunch ready in 1 hour :\-) \& ) || die $snpp\->message; \& \& $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. \fBsite()\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, YESNO, SIMREPLY, MULTICHOICE,\s0 and \s-1TEXT.\s0 (Level 3 command) .IP "message_response ( \s-1INT TEXT\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 \fBreply_type()\fR before specifying responses. .IP "message_status ( \s-1MSGID MSGID\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 \fBsend_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 \fBsend()\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; \& \& 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]; \& \& _\|_END_\|_ \& \& use Net::SNPP; \& \& my $snpp = Net::SNPP\->new( "snpp.provider.com" ); \& my @status = $snpp\->message_status( $ARGV[0], $ARGV[1] ); \& $snpp\->quit; \& \& 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\f(CI$Id:\fI \s-1SNPP\s0.pm,v 1.9 2004/01/27 22:18:32 tobeya Exp $\fR