Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    SMS::Handler::Dispatcher 0.01

    Download button

    No screenshots available
    Downloads: 513  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Luis E. Muñoz | More programs
    Perl Artistic License / FREE
    September 24th, 2007, 18:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    SMS::Handler::Dispatcher description

    SMS::Handler::Dispatcher is a helper class for dispatch - based SMS handlers.

    SMS::Handler::Dispatcher is a helper class for dispatch - based SMS handlers.

    SYNOPSIS

    use SMS::Handler::Dispatcher;
    package MyHandler;
    @ISA = qw(SMS::Handler::Dispatcher);

    ...

    This module provides a base class that implements a dispatch table based on the commands contained in the given SMS. Commands consist of words (sequences of characters matching w) or its abbreviations preceded by a single dot.

    The following methods are provided:

    ->handle()

    Dispatch the required command to the handlers set up by the invoking class. The command to method mapping is assumed to be supplied by the object when calling ->abbrevs (for the command abbreviations) or ->cmds for the command mapping. ->abbrevs must return a reference to a hash where each key is a possible command abbreviation andd its value, is the actual command.

    ->cmds must return a reference to a hash, where each key is a command and each value is a reference to the corresponding method to call. This class includes dummy methods that simply return ->{abbrevs} or ->{cmds} respectively.

    Each of the methods implementing a command, will be called with the following arguments.

    A reference to the object.

    The hash reference passed to ->handle.

    A compact representation of the source address, made from concatenating the NPI, TON and SOURCE with dots.

    A reference to the command line of the SMS (or the whole SMS if no separate lines).

    A reference to the remainder of the SMS.

    A positive return value from said methods, tell ->handle to keep looking for commands. A false return value, stops the search for further commands. In any case, ->handle will return SMS_STOP | SMS_DEQUEUE.

    If no corresponding command can be found for a given SMS, the ->dispatch_error method will be invoked, using the same calling protocol than command methods. Its return value will be returned by ->handle.

    The calling protocol depicted above is only attempted if the object contains $self->{number}. In this case, the SMS destination address is matched against $self-< gt{dest_addr_ton} >, $self-< gt{dest_addr_npi} > and $self-< gt{dest_addr_destination_addr} >. Only if this match succeeds, the message is accepted. This allows an object to restrict the numbers it handles. SMS_CONTINUE is returned in this case, to allow other objects a chance to process this message.

    ->dispatch_error

    sub dispatch_error { croak "Classes based on SMS::Handler::Dispatcher must implement their dispatch_method()n"; }

    ->abbrevs

    Return $self-{abbrevs}>.

    ->cmds

    Return $self-{cmds}>.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    dispatch helper | SMS handlers | Perl module | dispatch | helper | SMS

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM