From 7fd4dd5d86074afc6acb0375e2d20e28584c2327 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 9 Jul 2010 16:48:16 +0200 Subject: Improve sendsmg() in localmarkdown2sms and localsendsms to use $from and $to (not us $sms_phone and reuse $phone). --- localsendsms | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'localsendsms') diff --git a/localsendsms b/localsendsms index 8e33cd2..ad4b749 100755 --- a/localsendsms +++ b/localsendsms @@ -69,7 +69,7 @@ sub transliterate { } sub sendmsg { - my ($phone, $desc, $msg) = @_; + my ($from, $to, $desc, $msg) = @_; unless ($dummy) { my $ua = LWP::UserAgent->new(agent => "localsendsms"); @@ -77,9 +77,9 @@ sub sendmsg { my $url = $sms_url . '?' . $sms_usertag . '=' . uri_escape($sms_user) . '&password=' . uri_escape($sms_pw) - . '&to=' . uri_escape($phone); + . '&to=' . uri_escape($to); $url .= '&api_id=' . uri_escape($sms_api) if ($sms_api); - $url .= '&from=' . uri_escape($sms_phone) if ($sms_phone); + $url .= '&from=' . uri_escape($from) if ($from); $url .= '&smsc=' . uri_escape($sms_smsc) if ($sms_smsc); $url .= '&concatenation=true' if ($sms_concatenation); $url .= '&concat=' . uri_escape($sms_concat) if ($sms_concat); @@ -97,11 +97,11 @@ sub sendmsg { } DEBUG "Done $desc"; } else { - print STDERR "\n --> $phone: $desc\n"; + print STDERR "\n [$from --> $to: $desc]\n\n"; print STDERR $msg . "\n"; } } -&sendmsg($phone, "message", "@ARGV"); +&sendmsg($sms_phone, $phone, "message", "@ARGV"); 1; -- cgit v1.2.3