Lines 241-247
sub sip_protocol_loop {
Link Here
|
241 |
my $self = shift; |
241 |
my $self = shift; |
242 |
my $service = $self->{service}; |
242 |
my $service = $self->{service}; |
243 |
my $config = $self->{config}; |
243 |
my $config = $self->{config}; |
244 |
my $timeout = $self->{service}->{timeout} || $config->{timeout} || 30; |
244 |
my $timeout = $self->{service}->{client_timeout} || $config->{client_timeout}; |
245 |
my $input; |
245 |
my $input; |
246 |
|
246 |
|
247 |
# The spec says the first message will be: |
247 |
# The spec says the first message will be: |
Lines 258-267
sub sip_protocol_loop {
Link Here
|
258 |
# |
258 |
# |
259 |
# In short, we'll take any valid message here. |
259 |
# In short, we'll take any valid message here. |
260 |
#my $expect = SC_STATUS; |
260 |
#my $expect = SC_STATUS; |
261 |
local $SIG{ALRM} = sub { die "SIP Timed Out!\n"; }; |
261 |
local $SIG{ALRM} = sub { die "SIP Timed Out!\n"; } if $timeout; |
262 |
my $expect = ''; |
262 |
my $expect = ''; |
263 |
while (1) { |
263 |
while (1) { |
264 |
alarm $timeout; |
264 |
if ($timeout) { |
|
|
265 |
alarm $timeout; |
266 |
} |
265 |
$input = read_SIP_packet(*STDIN); |
267 |
$input = read_SIP_packet(*STDIN); |
266 |
unless ($input) { |
268 |
unless ($input) { |
267 |
return; # EOF |
269 |
return; # EOF |
Lines 287-293
sub sip_protocol_loop {
Link Here
|
287 |
} |
289 |
} |
288 |
# We successfully received and processed what we were expecting |
290 |
# We successfully received and processed what we were expecting |
289 |
$expect = ''; |
291 |
$expect = ''; |
290 |
alarm 0; |
292 |
if ($timeout ) { |
|
|
293 |
alarm 0; |
294 |
} |
291 |
} |
295 |
} |
292 |
} |
296 |
} |
293 |
|
297 |
|