From feaefccda3f51e18aecce1512b909770a010a709 Mon Sep 17 00:00:00 2001 From: djfiander Date: Tue, 21 Mar 2006 00:15:55 +0000 Subject: [PATCH] Fix package name, initialize ILS module. --- SIPServer.pm | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/SIPServer.pm b/SIPServer.pm index 5b95f6a..dcf1db5 100644 --- a/SIPServer.pm +++ b/SIPServer.pm @@ -1,4 +1,4 @@ -package ACSServer; +package SIPServer; use strict; use warnings; @@ -51,7 +51,7 @@ print Dumper(@parms); # # This is the main event. -ACSServer->run(@parms); +SIPServer->run(@parms); # # Child @@ -205,6 +205,10 @@ sub telnet_transport { syslog("LOG_INFO", "telnet_transport: shutting down"); } + +sub http_transport { +} + # # The terminal has logged in, using either the SIP login process # over a raw socket, or via the pseudo-unix login provided by the @@ -218,6 +222,17 @@ sub sip_protocol_loop { local $/ = "\r"; # SIP protocol message terminator + # + # initialize connection to ILS + # + $self->{ils} = new ILS $self->{account}->{institution}; + + + if (!$self->{ils}) { + syslog("LOG_ERR", "%s: ILS connection to '%s' failed, exiting", + $self->{service}, $self->{institution}); + die("ILS initialization failed"); + } # Now that the terminal has logged in, the first message # we recieve must be an SC_STATUS message. But it might be # an SC_REQUEST_RESEND. So, as long as we keep receiving @@ -249,5 +264,3 @@ sub sip_protocol_loop { $expect = ''; } } -sub http_transport { -} -- 2.11.0