From 9b6b357ae91515323c0c1e6b7a6e2b1d28e45c08 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 14 Dec 2009 22:10:02 +0100 Subject: [PATCH] login to sip2 server --- sc-emulator.pl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 sc-emulator.pl diff --git a/sc-emulator.pl b/sc-emulator.pl new file mode 100755 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/; + -- 2.20.1