SMS::MT - send mobile terminated SMS messages. |
SMS::MT - send mobile terminated SMS messages.
use SMS::MT;
my $sm = new SMS::MT('UID' => 'joeblow', 'PWD' => 'secret', 'PLUGIN' => 'WirelessServices');
# Send text message unless($sm->send_text('Hello world!', '+31611112222', {'FROM' => 'Joe'})) { die "Failed to send SMS.\n" . 'Error code: ' . $sm->get_last_error_code() . "\n" . 'Error msg: ' . $sm->get_last_error_message() . "\n"; }
# Send picture unless($sm->send_picture(\$otadata, '+31611112222', {'FROM' => 'Joe', 'MSG' => 'Like my picture?'})) { die "Failed to send SMS.\n" . 'Error code: ' . $sm->get_last_error_code() . "\n" . 'Error msg: ' . $sm->get_last_error_message() . "\n"; }
# Send logo unless($sm->send_logo(\$otadata,$mccode,'+31611112222')) { die "Failed to send SMS.\n" . 'Error code: ' . $sm->get_last_error_code() . "\n" . 'Error msg: ' . $sm->get_last_error_message() . "\n"; }
# Send CLI / group icon to 2 recipients unless($sm->send_groupicon(\$otadata,'+31611112222,+31600001111')) { die "Failed to send SMS.\n" . 'Error code: ' . $sm->get_last_error_code() . "\n" . 'Error msg: ' . $sm->get_last_error_message() . "\n"; }
# Send ringtone my $rtttl = 'Flntstn:d=4,o=5,b=200:g#,c#,8p,c#6,8a#,g#,c#,' . '8p,g#,8f#,8f,8f,8f#,8g#,c#,d#,2f,2p,g#,c#,8p,' . 'c#6,8a#,g#,c#,8p,g#,8f#,8f,8f,8f#,8g#,c#,d#,2c#'; unless($sm->send_ringtone($rtttl,'+31611112222)) { die "Failed to send SMS.\n" . 'Error code: ' . $sm->get_last_error_code() . "\n" . 'Error msg: ' . $sm->get_last_error_message() . "\n"; }
SMS::MT is a class that uses plugin modules to send mobile terminated SMS messages via a simple and standard interface. All plugins are accessed through the methods this class provides. This way, only one class and it's methods can be used for different SMS MT services without the user having to go into the details of how each of these services work.
get_plugin_names()
Examples: my @plugins_array = SMS::MT->get_plugin_names(); my $plugins_ref = SMS::MT->get_plugin_names();
get_last_error_code()
get_last_error_message()
get_max_text_length()
get_service_name()
send_groupicon(\$data,$recipients,\%options)
The first parameter contains a contains a reference to $data, the binary image data in OTA bitmap format.
The second parameter $recipients contains a comma seperated string or a reference to an array of recipients in international phone number format.
The third parameter is optional and if present it then it must be a reference to a hash of options. %options may have any of the following keys: FROM, VALIDITY, FLASH, CALLBACK, TYPE.
The result contains a boolean value.
The first parameter contains a contains a reference to $data, the binary image data in OTA bitmap format.
The second parameter $recipients contains a comma seperated string or a reference to an array of recipients in international phone number format.
The third parameter $mccode must contain the mc code / operator code used that all recipients belong to. It is up to the caller to ensure that all recipients in $recipients belong share the same mc code / operator code.
The fourth parameter is optional and if present it then it must be a reference to a hash of options. %options may have any of the following keys: FROM, VALIDITY, FLASH, CALLBACK, TYPE.
The result contains a boolean value.
send_picture($data,$recipients,\%options)
You may also send a text message along with the picture message by adding the pair 'MSG' => $textmessage to the %options hash.
send_ringtone($rtttl,$recipients,\%options)
The first parameter $rtttl contains (a reference to) a RTTTL string.
The second parameter $recipients contains a comma seperated string or a reference to an array of recipients in international phone number format.
The third parameter is optional and if present it then it must be a reference to a hash of options. %options may have any of the following keys: FROM, VALIDITY, FLASH, CALLBACK, NAME, TYPE.
The result contains a boolean value.
send_text($text,$recipients,\%options)
The first parameter $text contains the message text.
The second parameter $recipients contains a comma seperated string or a reference to an array of recipients in international phone number format.
The third parameter is optional and if present it then it must be a reference to a hash of options. %options may have any of the following keys: FROM, VALIDITY, FLASH, CALLBACK.
The result contains a boolean value.
All send*() methods support optional parameters that are passed as a reference to a hash.
Below is a list of all possible optional parameter keys and what kind of values are to be associated with them.
The plugin must also have a new()
constructor that accepts a hash of parameters
containing keys: UID and PWD. UID is the user id and PWD is the password needed
to login to the SMS service.
Craig Manley c.manley@skybound.nl
Copyright (C) 2001 Craig Manley <c.manley@skybound.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under under the same terms as Perl itself. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SMS::MT - send mobile terminated SMS messages. |