Bugzilla – Attachment 34284 Details for
Bug 13432
SIP Server does not respect timeout setting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13432 - SIP Server does not respect timeout setting
Bug-13432---SIP-Server-does-not-respect-timeout-se.patch (text/plain), 2.13 KB, created by
Kyle M Hall (khall)
on 2014-12-10 18:46:41 UTC
(
hide
)
Description:
Bug 13432 - SIP Server does not respect timeout setting
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-12-10 18:46:41 UTC
Size:
2.13 KB
patch
obsolete
>From f9b357f926676fca6d83a5f8c7e209336c7322d7 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 10 Dec 2014 12:27:59 -0500 >Subject: [PATCH] Bug 13432 - SIP Server does not respect timeout setting > >Koha's SIP server accepts timeout parameters, but those parameters >are only used for the login portion of a telnet transport session. >Other than that, they are ignored, and as long as whatever opened >the connection keeps it open, it will stay open indefinitely. > >Test Plan: >1) Set the timeout setting on your SIP server to 10 seconds >2) Modify misc/sip_cli_emulator.pl, add "sleep 100;" directly after line 91 >3) Start your SIP server >4) Run the modified sip script with valid parameters >5) Watch the SIP server stderr >6) Note that even though the script waits far too long before continuing, > the SIP server never kills the connection, and the requests the cli > script makes come back with valid data. >7) Apply this patch >8) Restart your SIP server >9) Repeat step 4 >10) Note that this time you see "SIP Timed Out!" in the SIP server > stderr and when the script finally makes it's request, it doesn't > come back with valid data. >--- > C4/SIP/SIPServer.pm | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > >diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm >index 45d8007..3560c0b 100755 >--- a/C4/SIP/SIPServer.pm >+++ b/C4/SIP/SIPServer.pm >@@ -230,6 +230,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: >@@ -246,8 +247,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 >@@ -273,6 +276,7 @@ sub sip_protocol_loop { > } > # We successfully received and processed what we were expecting > $expect = ''; >+ alarm 0; > } > } > >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13432
:
34284
|
34982
|
35573