@@ -, +, @@ the SIP server never kills the connection, and the requests the cli script makes come back with valid data. stderr and when the script finally makes it's request, it doesn't come back with valid data. --- C4/SIP/SIPServer.pm | 4 ++++ 1 file changed, 4 insertions(+) --- a/C4/SIP/SIPServer.pm +++ a/C4/SIP/SIPServer.pm @@ -238,6 +238,7 @@ sub sip_protocol_loop { my $self = shift; my $service = $self->{service}; my $config = $self->{config}; + my $timeout = $self->{service}->{timeout} || $config->{timeout} || 30; my $input; # The spec says the first message will be: @@ -254,8 +255,10 @@ sub sip_protocol_loop { # # In short, we'll take any valid message here. #my $expect = SC_STATUS; + local $SIG{ALRM} = sub { die "SIP Timed Out!\n"; }; my $expect = ''; while (1) { + alarm $timeout; $input = Sip::read_SIP_packet(*STDIN); unless ($input) { return; # EOF @@ -281,6 +284,7 @@ sub sip_protocol_loop { } # We successfully received and processed what we were expecting $expect = ''; + alarm 0; } } --