Subject: | Net::SIP::Dispatcher i2legs always fails dictionary check if one is provided |
Date: | Mon, 24 Apr 2017 09:50:14 +0000 |
To: | "bug-Net-SIP [...] rt.cpan.org" <bug-Net-SIP [...] rt.cpan.org> |
From: | Richard Carver <richard.carver [...] cloudmont.co.uk> |
Net::SIP::Dispatcher i2legs checks if the last parameter is a reference, and if it is then it checks that it matches the current leg dictionary. However if fails to dereference the dictionary argument so the check always fails and it will always return no legs in this use-case.
The default contact rewriter in StatelessProxy does not provide a dictionary reference, so it is not affected by this bug.
*** /usr/local/share/perl5/Net/SIP/Dispatcher.pm.orig 2017-04-24 09:35:44.083220946 +0000
--- /usr/local/share/perl5/Net/SIP/Dispatcher.pm 2017-04-24 09:34:23.046382867 +0000
*************** sub i2legs {
*** 345,351 ****
my Net::SIP::Dispatcher $self = shift;
my $legs = $self->{legs};
if (ref($_[-1])) {
! return if pop(@_) ne join("|",map { $_->key } @$legs);
}
return @{$legs}[@_];
}
--- 345,351 ----
my Net::SIP::Dispatcher $self = shift;
my $legs = $self->{legs};
if (ref($_[-1])) {
! return if ${pop(@_)} ne join("|",map { $_->key } @$legs);
}
return @{$legs}[@_];
}