my $service = $self->{service};
my $config = $self->{config};
my $input;
+ my $timeout = $self->{service}->{timeout} || $config->{timeout} || 0;
# Now that the terminal has logged in, the first message
# we recieve must be an SC_STATUS message. But it might be
#$expect = SC_STATUS;
$expect = '';
+ alarm $timeout; # First loop timeout
while ( $input = Sip::read_SIP_packet(*STDIN) ) {
+ alarm 0; # Don't timeout while we are processing
$input =~ s/[\r\n]+$//sm; # Strip off any trailing line ends
my $status = Sip::MsgType::handle($input, $self, $expect);
# We successfully received and processed what we were expecting
$expect = '';
+ alarm $timeout; # Next loop timeout
}
}