The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SMS::Send::IN::eSMS - Regional context SMS::Send driver to send messages via eSMS Kerala gateway ( http://api.esms.kerala.gov.in )

VERSION

version 0.01

SYNOPSIS

  use SMS::Send;

  # Create a sender
  my $sender = SMS::Send->new(
      'IN::eSMS',
      _login    => 'username',
      _password => 'password',
      _senderid => 'senderid',
  );

  # Send a message
  my $sent = $sender->send_sms(
      text => 'This is a test message',
      to   => '919876012345',
  );

  if ($sent) {
      print "Message send OK\n";
  }
  else {
      print "Failed to send message\n";
  }

DESCRIPTION

An Indian regional context driver for SMS::Send to send SMS text messages via eSMS Kerala gateway in India - http://api.esms.kerala.gov.in

This is not intended to be used directly, but instead called by SMS::Send (see synopsis above for a basic illustration, and see SMS::Send's documentation for further information).

The driver uses the eSMS's HTTP GET API mechanism. This is documented in the Developer documentation available to customers of the service.

METHODS

new

Constructor, takes argument pairs passed by SMS::Send, returns an SMS::Send::IN::eSMS object. See usage synopsis for example, and see SMS::Send documentation for further info on using SMS::Send drivers.

Additional arguments that may be passed include:-

_endpoint

The HTTP API endpoint. Defaults to http://api.esms.kerala.gov.in/fastclient/SMSclientdr.php

_debug

Whether debugging information is output or not.

send_sms

Send the message - see SMS::Send for details. Briefly it requires two principal parameters to function:

"text"

Used to supply the 160 character message body.

"to"

Destination mobile phone number in India. Numbered as per NNP 2003 i.e. 91XXYYYZZZZZ.

MISCELLANEOUS

Recipient phone number checks

Additional checks have been placed into the code for ensuring compliance with Indian National Numbering Plan 2003 (and its subsequent amendments). This measure is expected to prevent user generated errors due to improperly formatted or invalid mobile numbers, as noted below:

Example 1 : "819XXXXYYYYY"

81 is an invalid country code. As an India specific driver, the country code must be 91.

Example 2 : "9XXXXYYYYY"
Example 3 : "8XXXXYYYYY"
Example 4 : "7XXXXYYYYY"

As per National Numbering Plan 2003, cell phone numbers (both GSM and CDMA) have to start with 9XXXX / 8XXXX / 7XXXX series (access code + operator identifier). A phone number that does not fit this template will be rejected by the driver.

Example 5 : "12345678"
Example 6 : "12345678901234"

A phone number that is less than 10-digits long or over 12-digits long (including country code prefix) will be rejected as invalid input as per NNP 2003.

Example 7 : "+91 9XXXX YYYYY"
Example 8 : "+91-9XXXX-YYYYY"
Example 9 : "+919XXXXYYYYY"
Example 10 : "09XXXXYYYYY"

Phone numbers formatted as above, when input to the driver will be handled as "919XXXXYYYYY"

Error Codes

The following error codes are returned by the eSMS HTTP API:

401 - Credentials Error, may be invalid username or password
402 - 1 message submitted successfully
403 - Credits not available
404 - Internal Database Error
405 - Internal Networking Error
406 - Invalid or Duplicate numbers
407 - Network Error on SMSC
408 - Network Error on SMSC
409 - SMSC response timed out, message will be submitted
410 - Internal Limit Exceeded, Contact support
411 - Sender ID not approved.
412 - Sender ID not approved.
413 - Suspect Spam, we do not accept these messages.
414 - Rejected by varous reasons by the operator such as DND, SPAM etc

INSTALLATION

See perlmodinstall for information and options on installing Perl modules.

BUGS AND LIMITATIONS

You can make new bug reports, and view existing ones, through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=SMS-Send-IN-eSMS.

AVAILABILITY

The project homepage is https://metacpan.org/release/SMS-Send-IN-eSMS.

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see https://metacpan.org/module/SMS::Send::IN::eSMS/.

ACKNOWLEDGEMENT

Driver development cost was sponsored by State Librarian, State Central Library, Trivandrum, Kerala. Also noted thankfully the facilitation done by KELTRON and other individuals associated with the project who made it possible to write and release this driver as Free Software.

Severel existing drivers both international and regional, were inspiration and source for liberal copying.

AUTHOR

Indranil Das Gupta <indradg@l2c2.co.in> (for L2C2 Technologies).

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Indranil Das Gupta.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself, or at your option, any later version of Perl 5 you may have available.

This software comes with no warranty of any kind, including but not limited to the implied warranty of merchantability.

Your use of this software may result in charges against / use of available credits on your eSMS account. Please use this software carefully keeping a close eye on your usage and/or billing, The author takes no responsibility for any such charges accrued.

Document published by L2C2 Technologies [ http://www.l2c2.co.in ]