Commit 4943bd7b authored by Steffen Ullrich's avatar Steffen Ullrich

continued from bfb114e3 - add not only the test but also the actual fix

parent bfb114e3
......@@ -84,6 +84,7 @@ t/18_register_with_auth_step_by_step.t
t/19_call_with_dtmf.t
t/20_channel_on_hold.t
t/21_channel_on_hold_stateless_proxy.t
t/22_stateless_proxy_ack_on_error.t
t/certs/caller.sip.test.pem
t/certs/listen.sip.test.pem
t/certs/proxy.sip.test.pem
......
......@@ -9,7 +9,7 @@ use strict;
use warnings;
package Net::SIP::StatelessProxy;
use fields qw( dispatcher rewrite_contact nathelper force_rewrite );
use fields qw( dispatcher rewrite_contact nathelper force_rewrite respcode );
use Net::SIP::Util ':all';
use Digest::MD5 qw(md5);
......@@ -254,6 +254,7 @@ sub receive {
}
}
$self->{respcode} = $packet->code;
__forward_response( $self, \%entry );
} else {
......@@ -729,8 +730,13 @@ sub do_nat {
if ( ! $nathelper->activate_session( $callid,$cseq,$idfrom,$idto ) ) {
if ( $method eq 'ACK' ) {
DEBUG( 50,"session $callid|$cseq $idfrom -> $idto still incomplete in ACK" );
return [ 0,'incomplete session in ACK' ]
if ($self->{respcode} < 400) {
DEBUG( 50,"session $callid|$cseq $idfrom -> $idto still incomplete in ACK" );
return [ 0,'incomplete session in ACK' ]
} else {
# ignore problem, ACK to response with error code
DEBUG( 100, "session $callid|$cseq $idfrom -> ACK to failure response" );
}
} else {
# ignore problem, session not yet complete
DEBUG( 100, "session $callid|$cseq $idfrom -> $idto not yet complete" );
......
#!/usr/bin/perl
# testing behavior with inactive channels (i.e. no data receive) and Proxy
# like 20_channel_on_hold.t, only with proxy + NAT-helper in between
# make sure that ACK to error response gets passed through proxy
use strict;
use warnings;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment