View on
Luis Muñoz > SMS-Handler > SMS::Handler::Ping



Annotate this POD


New  2
Open  0
View/Report Bugs
Module Version: Revision: 1.7   Source  


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


  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({ ... });


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:


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 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.


Process the given SMS. The source and destination addresses are reversed.


None by default.


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.


$Log:,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


Luis E. Muñoz <>


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

syntax highlighting: