Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

SMS::Handler::Ping
Simple test for SMS::Handler

SMS::Handler::Ping - Simple test for SMS::Handler



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 the Queue::Dir manpage, 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

the SMS::Handler manpage, the Queue::Dir manpage, perl(1).

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy