Lines 134-140
sub raw_transport {
Link Here
|
134 |
|
134 |
|
135 |
# Timeout the while loop if we get stuck in it |
135 |
# Timeout the while loop if we get stuck in it |
136 |
# In practice it should only iterate once but be prepared |
136 |
# In practice it should only iterate once but be prepared |
137 |
local $SIG{ALRM} = sub { die 'raw transport Timed Out!' } |
137 |
local $SIG{ALRM} = sub { die 'raw transport Timed Out!' }; |
138 |
syslog('LOG_DEBUG', "raw_transport: timeout is $service->{timeout}"); |
138 |
syslog('LOG_DEBUG', "raw_transport: timeout is $service->{timeout}"); |
139 |
alarm $service->{timeout}; |
139 |
alarm $service->{timeout}; |
140 |
while (!$self->{account}) { |
140 |
while (!$self->{account}) { |
Lines 253-266
sub telnet_transport {
Link Here
|
253 |
# telnet transport. From that point on, both the raw and the telnet |
253 |
# telnet transport. From that point on, both the raw and the telnet |
254 |
# processes are the same: |
254 |
# processes are the same: |
255 |
sub sip_protocol_loop { |
255 |
sub sip_protocol_loop { |
256 |
my $self = shift; |
256 |
my $self = shift; |
257 |
my $service = $self->{service}; |
257 |
my $service = $self->{service}; |
258 |
my $config = $self->{config}; |
258 |
my $config = $self->{config}; |
259 |
my $timeout = $self->{service}->{timeout} || $config->{timeout} || 30; |
259 |
my $timeout = $self->{service}->{timeout} || $config->{timeout} || 30; |
260 |
|
260 |
|
261 |
# The spec says the first message will be: |
261 |
# The spec says the first message will be: |
262 |
# SIP v1: SC_STATUS |
262 |
# SIP v1: SC_STATUS |
263 |
# SIP v2: LOGIN (or SC_STATUS via telnet?) |
263 |
# SIP v2: LOGIN (or SC_STATUS via telnet?) |
264 |
# But it might be SC_REQUEST_RESEND. As long as we get |
264 |
# But it might be SC_REQUEST_RESEND. As long as we get |
265 |
# SC_REQUEST_RESEND, we keep waiting. |
265 |
# SC_REQUEST_RESEND, we keep waiting. |
266 |
|
266 |
|
Lines 268-276
sub sip_protocol_loop {
Link Here
|
268 |
# constraint, so we'll relax about it too. |
268 |
# constraint, so we'll relax about it too. |
269 |
# Using the SIP "raw" login process, rather than telnet, |
269 |
# Using the SIP "raw" login process, rather than telnet, |
270 |
# requires the LOGIN message and forces SIP 2.00. In that |
270 |
# requires the LOGIN message and forces SIP 2.00. In that |
271 |
# case, the LOGIN message has already been processed (above). |
271 |
# case, the LOGIN message has already been processed (above). |
272 |
# |
272 |
|
273 |
# In short, we'll take any valid message here. |
273 |
# In short, we'll take any valid message here. |
274 |
eval { |
274 |
eval { |
275 |
local $SIG{ALRM} = sub { |
275 |
local $SIG{ALRM} = sub { |
276 |
syslog( 'LOG_DEBUG', 'Inactive: timed out' ); |
276 |
syslog( 'LOG_DEBUG', 'Inactive: timed out' ); |
277 |
- |
|
|