NAME
SMS::Handler::Ping - Simple test for SMS::Handler
SYNOPSIS
use SMS::Handler::Ping;
my $h = SMS::Handler::Ping->new(-message => "It's alive",
-queue => $queue_obj,
-addr => '9.9.5551212',
-dest => '9.9.5551313',
);
$h->handle({ ... });
DESCRIPTION
This module implements a simple responder class. It will respond to any message directed to the specified phone number, with the specified message.
The following methods are provided:
->new()
-
Creates a new
SMS::Handler::Ping
object. It accepts parameters as a number of key / value pairs. The following parameters are supported.message => $message
-
The text of the message that must be returned. If it is left unspecified, the word "Pong" will be used.
Note that if the SMS text matches this, no answer will be produced to avoid loops.
queue => $queue_obj
-
An object obeying the interface defined in Queue::Dir, where the response message generated by this module will be stored.
addr => $my_addr
-
The address assigned to this service, in pon.npi.phone format. The destination address of the SMS, must match this argument. If this address is left unspecified, the SMS will be accepted no matter what destination address is used.
dest => $dest_addr
-
If this argument is supplied, any answers will be sent to this address.
->handle()
-
Process the given SMS. The source and destination addresses are reversed.
EXPORT
None by default.
LICENSE AND WARRANTY
This code comes with no warranty of any kind. The author cannot be held liable for anything arising of the use of this code under no circumstances.
This code is released under the terms and conditions of the GPL. Please see the file LICENSE that accompains this distribution for more specific information.
This code is (c) 2002 Luis E. Muñoz.
HISTORY
$Log: Ping.pm,v $ Revision 1.7 2003/01/14 20:32:34 lem Got rid of Net::SMPP::XML
Revision 1.6 2002/12/22 19:03:02 lem Set license GPL
Revision 1.5 2002/12/20 01:25:57 lem Changed emails for redistribution
Revision 1.4 2002/12/09 22:04:28 lem Added ::Blackhole
Revision 1.3 2002/12/09 21:40:25 lem Better error recovery
Revision 1.2 2002/12/09 20:53:58 lem Added loop prevention, a test for this and the possibility to specify a fixed destiantion address
Revision 1.1 2002/12/06 15:50:31 lem Added ::Ping and its tests
AUTHOR
Luis E. Muñoz <luismunoz@cpan.org>
SEE ALSO
SMS::Handler, Queue::Dir, perl(1).
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 214:
You forgot a '=back' before '=head2'
- Around line 228:
Non-ASCII character seen before =encoding in 'Muñoz.'. Assuming CP1252