projects
/
Biblio-SIP2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(initial)
login to sip2 server
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 14 Dec 2009 21:10:02 +0000
(22:10 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 14 Dec 2009 21:10:02 +0000
(22:10 +0100)
sc-emulator.pl
[new file with mode: 0755]
patch
|
blob
diff --git a/sc-emulator.pl
b/sc-emulator.pl
new file mode 100755
(executable)
index 0000000..
3be7d9b
--- /dev/null
+++ b/
sc-emulator.pl
@@ -0,0
+1,27
@@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use IO::Socket::INET;
+use autodie;
+
+our $user = 'sip2-user';
+our $password = 'sip2-paasswd';
+
+require 'config.pl' if -e 'config.pl';
+
+our $sock = IO::Socket::INET->new( '10.60.0.251:6001' );
+
+sub sip2 {
+ my ( $send, $patt ) = @_;
+ warn ">>>> $send";
+ print $sock $send;
+
+ my $in = <$sock>;
+ warn "<<<< $in";
+ die unless $in =~ $patt;
+}
+
+sip2 "9300CN$user|CO$password|\n" => qr/^941/;
+