@@ -, +, @@
---
C4/SIP/SIPServer.pm | 12 ++++++++----
etc/SIPconfig.xml | 19 +++++++++++++------
2 files changed, 21 insertions(+), 10 deletions(-)
--- a/C4/SIP/SIPServer.pm
+++ a/C4/SIP/SIPServer.pm
@@ -241,7 +241,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 $timeout = $self->{service}->{client_timeout} || $config->{client_timeout};
my $input;
# The spec says the first message will be:
@@ -258,10 +258,12 @@ 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"; };
+ local $SIG{ALRM} = sub { die "SIP Timed Out!\n"; } if $timeout;
my $expect = '';
while (1) {
- alarm $timeout;
+ if ($timeout) {
+ alarm $timeout;
+ }
$input = read_SIP_packet(*STDIN);
unless ($input) {
return; # EOF
@@ -287,7 +289,9 @@ sub sip_protocol_loop {
}
# We successfully received and processed what we were expecting
$expect = '';
- alarm 0;
+ if ($timeout ) {
+ alarm 0;
+ }
}
}
--- a/etc/SIPconfig.xml
+++ a/etc/SIPconfig.xml
@@ -16,12 +16,6 @@
/>
-
+
+
--