use constant DECONCAT_TOTAL => "_deconcat_total"; # internal: undef=>try single message, *=>try & messages
use constant TEXT_POSITION => "text_position"; # numeric position in $payload, UDH IE will be present only once
+use constant IEI_IMELODY => 0x0C; #IEI: User Defined Sound (iMelody max 128 bytes)
use constant IEI_ANIMATION_LARGE => 0x0E; #IEI: EMS large animation (16x16 x4 = 128 bytes)
use constant IEI_ANIMATION_SMALL => 0x0F; #IEI: EMS small animation ( 8x 8 x4 = 32 bytes)
use constant IEI_PICTURE_LARGE => 0x10; #IEI: EMS large picture (32x32 = 128 bytes)
);
}
+sub _ie_ems_melody {
+ my ($self, %args) = @_;
+
+ return $self->_iebuilder(IEI_IMELODY,
+ $args{TEXT_POSITION}, # position in the SMS
+ unpack("C*",$args{"textdata"}),
+ );
+}
+
sub _ie_alcatel {
my ($self, %args) = @_;
my $opt_ems_force_variable;
my $opt_ems_picture_send;
my $opt_ems_animation_send;
+my $opt_ems_melody_file_send;
my $opt_alcatel_name;
my $opt_alcatel_picture_send;
my $opt_alcatel_animation_send;
"ems-force-variable" => \$opt_ems_force_variable,
"ems-picture-send:s" => \$opt_ems_picture_send,
"ems-animation-send:s" => \$opt_ems_animation_send,
+ "ems-melody-file-send:s" => \$opt_ems_melody_file_send,
"alcatel-name:s" => \$opt_alcatel_name,
"alcatel-picture-send:s" => \$opt_alcatel_picture_send,
"alcatel-animation-send:s" => \$opt_alcatel_animation_send,
[--ems-force-variable]
[--ems-picture-send=<image file>]
[--ems-animation-send=<image file>]
+ [--ems-melody-file-send=<iMelody file>]
[--alcatel-name=<resource name>]
[--alcatel-picture-send=<image file>]
[--alcatel-animation-send=<image file>]
} ]);
}
+ if ($opt_ems_melody_file_send) {
+ local (*F);
+ open F, $opt_ems_melody_file_send;
+ my $ems_melody_file_data = <F>;
+ close F;
+ warn "EMS iMelody file format not recognized, wrapping anyway"
+ if $ems_melody_file_data!~/^BEGIN:IMELODY\r\n.*END:IMELODY\r\n$/s;
+ $nbs->sendsms($msisdn, "", udh=>[ {
+ "type"=>"ems_melody",
+ TEXT_POSITION=>0,
+ "textdata"=>$ems_melody_file_data,
+ } ]);
+ }
+
if ($opt_alcatel_picture_send) {
my $bitmap = GSM::SMS::Bitmap->new($opt_alcatel_picture_send);
my ($msg, $udh) = GSM::SMS::NBS::Alcatel->alcatel_picture($bitmap);