]> git.etc.gen.nz Git - spong.git/commitdiff
Verizon SMS Gateway (non-email-based)
authorJan Willamowius <jan@willamowius.de>
Tue, 13 Sep 2005 15:43:35 +0000 (15:43 +0000)
committerJan Willamowius <jan@willamowius.de>
Tue, 13 Sep 2005 15:43:35 +0000 (15:43 +0000)
src/lib/Spong/Message/plugins/msg_verizon [new file with mode: 0644]

diff --git a/src/lib/Spong/Message/plugins/msg_verizon b/src/lib/Spong/Message/plugins/msg_verizon
new file mode 100644 (file)
index 0000000..37b7a55
--- /dev/null
@@ -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;
+