summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlocalmarkdown2sms4
-rwxr-xr-xlocalsendsms4
2 files changed, 6 insertions, 2 deletions
diff --git a/localmarkdown2sms b/localmarkdown2sms
index 47a06f3..1767788 100755
--- a/localmarkdown2sms
+++ b/localmarkdown2sms
@@ -49,6 +49,7 @@ my $sms_concat = $ENV{SMS_CONCAT};
my $sms_dlr_mask = $ENV{SMS_DLR_MASK};
my $sms_dlr_url = $ENV{SMS_DLR_URL};
my $sms_validity = $ENV{SMS_VALIDITY};
+my $stripprefix = $ENV{stripprefix};
my $path = $ENV{mdpath};
my (%file, %delay, %reply);
@@ -62,7 +63,8 @@ my ($key) = lc (shift @ARGV);
# strip international prefix
# (prefix is optional some places and illegal at other places - forgot where)
-$phone =~ s/\+/ /g;
+$phone =~ s/^\+//g if ($stripprefix);
+$sms_phone =~ s/^\+//g if ($stripprefix);
# strip non-word chars from keyword (and use only first chunk of word chars)
$key =~ s/.*?(\w+).*?/$1/;
diff --git a/localsendsms b/localsendsms
index 6449e3c..ff82ffd 100755
--- a/localsendsms
+++ b/localsendsms
@@ -28,6 +28,7 @@ my $sms_concat = $ENV{SMS_CONCAT};
my $sms_dlr_mask = $ENV{SMS_DLR_MASK};
my $sms_dlr_url = $ENV{SMS_DLR_URL};
my $sms_validity = $ENV{SMS_VALIDITY};
+my $stripprefix = $ENV{stripprefix};
# decode data if passed from kannel
if ($urldecode) {
@@ -37,7 +38,8 @@ my ($phone) = shift @ARGV;
# strip international prefix
# (prefix is optional some places and illegal at other places - forgot where)
-#$phone =~ s/\+/ /g;
+$phone =~ s/^\+//g if ($stripprefix);
+$sms_phone =~ s/^\+//g if ($stripprefix);
if ($debug) {
Log::Log4perl->easy_init($DEBUG);