GSM-SMS

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

configure_requires:
    ExtUtils::MakeMaker:  0
build_requires:
    ExtUtils::MakeMaker:  0
requires:
    Data::Dumper:    0
    File::Path:      0
    File::stat:      0
    File::Temp:      0
    HTTP::Request:   0
    Image::Magick:   0
    Log::Agent:      0
    LWP::Simple:     0
    LWP::UserAgent:  0
    MIME::Base64:    0
    Test::More:      0
    URI::Escape:     0
    URI::URL:        0
no_index:
    directory:
        - t

Makefile.PL  view on Meta::CPAN


WriteMakefile(
    'NAME'			=> 'GSM::SMS',
    'VERSION'		=> $VERSION,
	'ABSTRACT'		=> 'Perl Modules For Smart Messaging',
    'PREREQ_PM'		=> {
		'Test::More'		=> 0,
		'Log::Agent'		=> 0,
		'MIME::Base64'		=> 0,
		'Data::Dumper'		=> 0,
		'Image::Magick'		=> 0,
		'LWP::UserAgent'	=> 0,
		'File::Temp'		=> 0,
		'HTTP::Request'		=> 0,
		'URI::URL'			=> 0,
		'URI::Escape'		=> 0,
		'LWP::Simple'		=> 0,
		'File::stat'		=> 0,
		'File::Path'		=> 0
	},
	'CONFIGURE'		=> \&configure,

README  view on Meta::CPAN

    Better error reporting
    Configuration wizard update

    Look in the 'Changes' file for a complete review and credits.

PREREQUISITES
    Following packages are mandatory

    Data::Dumper
    MIME::Base64
    Image::Magick
    LWP
    Device::SerialPort or Win32::SerialPort
    Log::Agent

    Note: Device::SerialPort and Win32::SerialPort are only necessary when
    using serial transport.

INSTALL
    It *should* be a simple:

README  view on Meta::CPAN

    you to receive the latest slashdot headlines in a SMS message. The ideas
    are ofcourse endless.

Win32 Specific issues
    Sometimes I need to open up a terminal program to connect to the modem
    manually. If I don't do that, Perl cannot connect to the serial port. I
    only need to do that one time, when I boot up the system. Afterwards,
    everything works fine.

    You probably will get warnings when running the test suite. These do not
    originate from GSM::SMS, but from Image::Magick. They are harmless I
    guess, as I did not see apatch from ActiveState yet.

BUGS
    Probably a lot. I hope I get a lot of feedback so we can figure the bugs
    out and start fixing them!

AUTHOR
    Johan Van den Brande <johan@vandenbrande.com>

COPYRIGHT

docs/README.pod  view on Meta::CPAN

=head1 PREREQUISITES

Following packages are mandatory

=over 4

=item Data::Dumper

=item MIME::Base64

=item Image::Magick

=item LWP

=item Device::SerialPort or Win32::SerialPort

=item Log::Agent

=back

B<Note:> Device::SerialPort and Win32::SerialPort are only necessary when using serial transport. 

docs/README.pod  view on Meta::CPAN

ofcourse endless. 

=head1 Win32 Specific issues

Sometimes I need to open up a terminal program to connect to the modem
manually. If I don't do that, Perl cannot connect to the serial port. I only
need to do that one time, when I boot up the system. Afterwards, everything
works fine.

You probably will get warnings when running the test suite. These do not
originate from GSM::SMS, but from Image::Magick. They are harmless I guess, as
I did not see apatch from ActiveState yet.

=head1 BUGS

Probably a lot. I hope I get a lot of feedback so we can figure the bugs out 
and start fixing them!

=head1 AUTHOR

Johan Van den Brande <johan@vandenbrande.com>

lib/GSM/SMS/NBS.pm  view on Meta::CPAN


  $nbs->sendOperatorLogo_b64( $msisdn, $country, $operator, $b64, $format);

An operator logo indicates the operator you are connected to for the moment. 
This is used to have a nice logo on your telephone all of the time. 

For this method you'll also need to provide a country code and an operator code.
I've assembled a list of country and operator codes for different mobile
operators in the file "I<docs/codes.txt>". For the moment there is no convenience class that implements the lookup of these code according to the mobile phone number. Due to the dynamic nature of these numbers - numbers can be kept when switching ope...

The method expects a base64 serialised image and the format of the image, 'gif', 'png'. The L<Image::Magick> package is used to process the image, this guarabntees a lot of supported formats. The image needs to be 71 by 14 pixels.

=cut

sub sendOperatorLogo_b64 {
	my ($self, $msisdn, $country, $operator, $b64, $format) = @_;
	
	my $ol = OTAOperatorlogo_fromb64( $country, $operator, $b64, $format );
	return $self->sendto( $msisdn, $ol, OTAOperatorlogo_PORT);
}

lib/GSM/SMS/NBS.pm  view on Meta::CPAN

	my ($self, $msisdn, $country, $operator, $file ) = @_;

	my $ol = OTAOperatorlogo_fromfile( $country, $operator, $file );
	return $self->sendto($msisdn, $ol, OTAOperatorlogo_PORT);
}

=item B<sendGroupGraphic_b64> - Send a group graphic

  $nbs->sendGroupGraphic_b64( $msisdn, $b64, $format);

Send a group graphic, also called a Caller Line Identification icon ( CLIicon ),to the recipient indicated by the telephone number $msisdn. It expects a base 64 encoded image and the format the image is in, like 'gif', 'png'. To find out which image ...

=cut

sub sendGroupGraphic_b64 {
	my ($self, $msisdn, $b64, $format) = @_;

	my $gg = OTACLIicon_fromb64( $b64, $format );
	return $self->sendto($msisdn, $gg, OTACLIicon_PORT);
}

lib/GSM/SMS/OTA/Bitmap.pm  view on Meta::CPAN

@EXPORT = qw( BITMAP_WIDTH BITMAP_HEIGHT BITMAP_HEIGHT_DOUBLE OTABitmap_makestream OTABitmap_fromfile OTABitmap_fromb64 );

$VERSION = "0.161";

use constant BITMAP_WIDTH  			=> 72;

use constant BITMAP_HEIGHT 			=> 14;
use constant BITMAP_HEIGHT_DOUBLE 	=> 28;

use MIME::Base64;
use Image::Magick;

sub OTABitmap_makestream {
	my ($width, $height, $depth, $ref_bytearray) = @_;


	my $stream='';

	$stream.= sprintf("%02X", $width);
	$stream.= sprintf("%02X", $height);
	$stream.= sprintf("%02X", $depth);
	foreach my $byte (@$ref_bytearray) {
		$stream.= uc unpack ('H2' , $byte);
	}
	return $stream;
}

sub OTABitmap_fromfile {
	my ($filename) = @_;

	my $image = Image::Magick->new( );
	return -1 unless $image; 

	$image->Read( $filename );

	# check image size(s)
	# 1. width
	return -1 unless ( $image->Get('columns') == BITMAP_WIDTH );
	
	# 2. height
	return -1 unless ( $image->Get('height') == BITMAP_HEIGHT 

lib/GSM/SMS/OTA/Bitmap.pm  view on Meta::CPAN

	
	undef $image;	
	return (\@ba, $width, $height);
}

sub OTABitmap_fromb64 {
	my ($b64image, $format) = @_;

	my $blob = decode_base64( $b64image );

	my $image = Image::Magick->new( magick => $format );
	return -1 unless $image; # wrong format ;-)

	$image->BlobToImage( $blob );

	# check image size(s)
	# 1. width
	return -1 unless ( $image->Get('columns') == BITMAP_WIDTH );
	
	# 2. height
	return -1 unless ( $image->Get('height') == BITMAP_HEIGHT 



( run in 1.469 second using v1.01-cache-2.11-cpan-beeb90c9504 )