TT#12660 Also send latin1 as gsm encoding.

Except for greek characters, which are available in the
GSM 03.38 encoding but not in latin-1, all other latin-1
characters can be sent with coding 0 (7bit).

We neither support the € sign available in the GSM extended
encoding, but for unknown reasons the rest of the extended
char sets (which are part of ascii anways) do work.

So, no € and no greek chars inside coding=0.

Change-Id: Ia87e337772e126b6a0a95b53acba0a369b71e660
changes/92/11892/3
Andreas Granig 9 years ago
parent 205bffc2d1
commit c9ca8baf79

@ -133,13 +133,7 @@ sub create_item {
}
my $error_msg = "";
my $coding;
if(NGCP::Panel::Utils::Utf8::is_within_ascii($resource->{text})) {
$coding = 0;
} else {
$coding = 2;
}
my $coding = NGCP::Panel::Utils::SMS::get_coding($resource->{text});
NGCP::Panel::Utils::SMS::send_sms(
c => $c,
caller => $resource->{caller},

@ -9,6 +9,24 @@ use Module::Load::Conditional qw/can_load/;
use NGCP::Panel::Utils::Utf8;
sub get_coding {
my $text = shift;
# if unicode, we have to use utf8 encoding, limiting our
# text length to 70; otherwise send as default
# encoding, allowing 160 chars
my $coding;
if(NGCP::Panel::Utils::Utf8::is_within_ascii($text) ||
NGCP::Panel::Utils::Utf8::is_within_latin1($text)) {
$coding = 0;
} else {
$coding = 2;
}
return $coding;
}
sub send_sms {
my (%args) = @_;
my $c = $args{c};
@ -23,14 +41,7 @@ sub send_sms {
}
unless(defined $coding) {
# if unicode, we have to use utf8 encoding, limiting our
# text length to 70; otherwise send as default
# encoding, allowing 160 chars
if(NGCP::Panel::Utils::Utf8::is_within_ascii($text)) {
$coding = 0;
} else {
$coding = 2;
}
$coding = get_coding($text);
}
my $schema = $c->config->{sms}{schema};

Loading…
Cancel
Save