NAME

NetSDS::Message::SMS - short message according to ETSI GSM 03.40

SYNOPSIS

use NetSDS::Message::SMS;

...

$msg = NetSDS::Message::SMS->new();
$msg->udh(conv_hex_str('050102030405');
$msg->ud('Hello there');

$msg->coding(COD_7BIT);

print "SM: " . $msg->message_body();

DESCRIPTION

This class provides API to SMS message data structure.

CLASS API

new() - class constructor

Implements SMS constructor.

my $object = NetSDS::Message::SMS->new();
coding() - set/get SMS coding

Paramters: new coding to set

Returns: message coding

$msg->coding(COD_UCS2);
mclass() - set/get message class

Paramters: new message class value

$msg->mclass(0); # Send as Flash SMS
udh() - set/get UDH

Paramters: UDH as binary string

Returns: UDH

$msg->udh(conv_hex_str('050.02130405');
ud() - set/get user data

Paramters: user data as binary string

Returns: user data

esm_class() - get esm_class from message

See 5.2.12 chapter of SMPP 3.4 specification for details.

$esm_class = $msg->esm_class();
dcs() - get data coding scheme

Returns data coding schmeme in accordance with ETSI GSM 03.38

$dcs = $msg->dcs();
message_body() - return SMS message body

Returns: SMS body as byte string (UDH + UD)

$msg_hex = conv_str_hex($msg->message_body);
text($string, $coding) - set SM data from text string

Paramters: string, SMS coding

# Set SMS text
$msg->text('Just some string', COD_7BIT);

This will set UDH to undef and UD to string in GSM 03.38.

EXPORTED FUNCTIONS

create_long_sm($text, $coding) - concatenated SMS sequence

Paramters: text string (UTF-8), SMS coding

Returns: array of NetSDS::Message::SMS objects

# Create 300 character string
my $long_str = 'abc'x100;

my @parts = create_long_sm($long_str, COD_7BIT);

EXAMPLES

See samples directory for examples.

BUGS

Unknown yet

SEE ALSO

* ETSI GSM 03.38 - alphabets and language specific information

* ETSI GSM 03.40 - SMS realization on GSM networks

* SMPP Protocol Specification v3.4

TODO

* Implement RPI and message mode support in esm_class()

* Implement MWI support in dcs() method

AUTHOR

Michael Bochkaryov <misha@rattler.kiev.ua>

LICENSE

Copyright (C) 2008 Michael Bochkaryov

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA