From: Jan Willamowius Date: Tue, 13 Sep 2005 15:43:35 +0000 (+0000) Subject: Verizon SMS Gateway (non-email-based) X-Git-Tag: spong-2_8_0-beta1~14 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a23563fe1dccdfa2b79280c2fae6b238550b9f92;p=spong.git Verizon SMS Gateway (non-email-based) --- diff --git a/src/lib/Spong/Message/plugins/msg_verizon b/src/lib/Spong/Message/plugins/msg_verizon new file mode 100644 index 0000000..37b7a55 --- /dev/null +++ b/src/lib/Spong/Message/plugins/msg_verizon @@ -0,0 +1,28 @@ +# Messaging function for Teletouch pagers using e-mail delivery via +# the e-mail status function + +$MSGFUNCS{'verizon'} = \&msg_verizon; + +sub msg_verizon { + my ($pager,$subject,$body) = @_; + + &verizon_page($pager,$subject,$body); + &debug( "verizon page sent to $pager" ); +} + +sub verizon_page { + my ($recipient,$subject,$body) = @_; + # Code here to post info to Verizon web form + use LWP::UserAgent; + $ua = new LWP::UserAgent; + $ua->agent("Spong Verizon Gateway/0.1 " . $ua->agent); + + my $req = new HTTP::Request POST => 'http://www.msg.myvzw.com/results.jsp'; + $req->content_type('application/x-www-form-urlencoded'); + $req->content("min=$recipient&showDisclaimer=n&Send.x=yes&sendername=spong&message=$body"); + my $res = $ua->request($req); +} + +# Required becuase I'm included perl code +1; +