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

NAME

SMS::Send::IN::Unicel - Regional context SMS::Send driver to send messages via Unicel Technologies (http://unicel.in/)

VERSION

version 0.01

SYNOPSIS

  use SMS::Send;

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

  # 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 Unicel Technologies in India - http://unicel.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 Unicel's HTTP GET API mechanism. This is documented in the Developer documentation available to paying customers of the service.

METHODS

new

Constructor, takes argument pairs passed by SMS::Send, returns an SMS::Send::IN::Unicel 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 https://unicel.in/SendSMS/sendmsg.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 Unicel HTTP API:

0x201 - Account suspended due to one of several defined reasons.
0x202 - Invalid Source Address/Sender ID.
0x203 - Message length exceeded (more than 160 characters) if concat is set to 0 Message.
0x204 - Message length exceeded (more than 459 characters) in concat is set to 1.
0x205 - DRL URL is not set.
0x206 - Only the subscribed service type can be accessed - make sure of the service type you are trying to connect with.
0x207 - Invalid Source IP - kindly check if the IP is responding.
0x208 - Account deactivated/expired.
0x209 - Invalid message length (less than 160 characters) if concat is set to 1.
0x210 - Invalid Parameter values.
0x211 - Invalid Message Length (more than 280 characters).
0x212 - Invalid Message Length.
0x213 - Invalid Destination Number.

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

AVAILABILITY

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

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::Unicel/.

ACKNOWLEDGEMENT

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

AUTHOR

Indranil Das Gupta <indradg@l2c2.co.in> (on behalf of L2C2 Technologies).

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 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 Unicel 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 ]