Lines 243-249
sub sip_protocol_loop {
Link Here
|
243 |
my $self = shift; |
243 |
my $self = shift; |
244 |
my $service = $self->{service}; |
244 |
my $service = $self->{service}; |
245 |
my $config = $self->{config}; |
245 |
my $config = $self->{config}; |
246 |
my $timeout = $self->{service}->{timeout} || $config->{timeout} || 30; |
246 |
my $timeout = $self->{service}->{client_timeout} || $config->{client_timeout}; |
247 |
|
247 |
|
248 |
# The spec says the first message will be: |
248 |
# The spec says the first message will be: |
249 |
# SIP v1: SC_STATUS |
249 |
# SIP v1: SC_STATUS |
Lines 263-275
sub sip_protocol_loop {
Link Here
|
263 |
syslog( 'LOG_DEBUG', 'Inactive: timed out' ); |
263 |
syslog( 'LOG_DEBUG', 'Inactive: timed out' ); |
264 |
die "Timed Out!\n"; |
264 |
die "Timed Out!\n"; |
265 |
}; |
265 |
}; |
266 |
my $previous_alarm = alarm($timeout); |
266 |
my $previous_alarm; |
|
|
267 |
$previous_alarm = alarm($timeout) if $timeout; |
267 |
|
268 |
|
268 |
while ( my $inputbuf = read_request() ) { |
269 |
while ( my $inputbuf = read_request() ) { |
269 |
if ( !defined $inputbuf ) { |
270 |
if ( !defined $inputbuf ) { |
270 |
return; #EOF |
271 |
return; #EOF |
271 |
} |
272 |
} |
272 |
alarm($timeout); |
273 |
alarm($timeout) if $timeout; |
273 |
|
274 |
|
274 |
unless ($inputbuf) { |
275 |
unless ($inputbuf) { |
275 |
syslog( "LOG_ERR", "sip_protocol_loop: empty input skipped" ); |
276 |
syslog( "LOG_ERR", "sip_protocol_loop: empty input skipped" ); |
Lines 287-293
sub sip_protocol_loop {
Link Here
|
287 |
} |
288 |
} |
288 |
next if $status eq REQUEST_ACS_RESEND; |
289 |
next if $status eq REQUEST_ACS_RESEND; |
289 |
} |
290 |
} |
290 |
alarm($previous_alarm); |
291 |
alarm($previous_alarm) if $previous_alarm; |
291 |
return; |
292 |
return; |
292 |
}; |
293 |
}; |
293 |
if ( $@ =~ m/timed out/i ) { |
294 |
if ( $@ =~ m/timed out/i ) { |