|
NAMESMS::Send - Driver-based API for sending SMS messagesSYNOPSIS# Create a sender my $sender = SMS::Send->new('SomeDriver', _login => 'myname', _password => 'mypassword', ); # Send a message my $sent = $sender->send_sms( text => 'This is a test message', to => '+61 (4) 1234 5678', ); # Did the send succeed. if ( $sent ) { print "Message sent ok\n"; } else { print "Failed to send message\n"; } DESCRIPTION"SMS::Send" is intended to provide a driver-based single API for sending SMS and MMS messages. The intent is to provide a single API against which to write the code to send an SMS message.At the same time, the intent is to remove the limits of some of the previous attempts at this sort of API, like "must be free internet-based SMS services". "SMS::Send" drivers are installed seperately, and might use the web, email or physical SMS hardware. It could be a free or paid. The details shouldn't matter. You should not have to care how it is actually sent, only that it has been sent (although some drivers may not be able to provide certainty). METHODSinstalled_driversThe "installed_drivers" the list of SMS::Send drivers that are installed on the current system.new# The most basic sender $sender = SMS::Send->new('Test'); # Indicate regional driver with :: $sender = SMS::Send->new('AU::Test'); # Pass arbitrary params to the driver $sender = SMS::Send->new('MyDriver', _login => 'adam', _password => 'adam', ); The "new" constructor creates a new SMS sender. It takes as its first parameter a driver name. These names map the class names. For example driver "Test" matches the testing driver SMS::Send::Test. Any additional params should be key/value pairs, split into two types. Params without a leading underscore are "public" options and relate to standardised features within the SMS::Send API itself. At this time, there are no usable public options. Params with a leading underscore are "private" driver-specific options and will be passed through to the driver unchanged. Returns a new SMS::Send object, or dies on error. send_sms# Send a message to a particular address my $result = $sender->send_sms( text => 'This is a test message', to => '+61 4 1234 5678', ); The "send_sms" method sends a standard text SMS message to a destination phone number. It takes a set of named parameters to describe the message and its destination, again split into two types. Params without a leading underscore are "public" options and relate to standardised features within the SMS::Send API itself.
Any parameters with a leading underscore are considered private driver-specific options and will be passed through without alteration. Any other parameters without a leading underscore will be silently stripped out and not passed through to the driver. After calling "send_sms" the driver will do whatever is required to send the message, including (potentially, but not always) waiting for a confirmation from the network that the SMS has been sent. Given that drivers may do the actual mechanics of sending a message by quite a large variety of different methods the "send_sms" method may potentially block for some time. Timeout functionality is expected to be added later. The "send_sms" returns true if the message was sent, or the driver is fire-and-forget and unable to determine success, or false if the message was not sent. SUPPORTBugs should be reported via the CPAN bug tracker at<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SMS-Send> For other issues, contact the author. AUTHORAdam Kennedy <adamk@cpan.org>COPYRIGHTCopyright 2005 - 2011 Adam Kennedy.This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module.
Visit the GSP FreeBSD Man Page Interface. |