Subject: | Undefined value in Net::SIP::Leg forward_outgoing |
Date: | Fri, 27 Jan 2017 16:59:25 +0000 |
To: | "bug-Net-SIP [...] rt.cpan.org" <bug-Net-SIP [...] rt.cpan.org> |
From: | Richard Carver <richard.carver [...] cloudmont.co.uk> |
If the SIP client does not specify a branch in the Via header then perl warns of an undefined value in forward_outgoing:
if (substr( $param->{branch},0,length($branch) ) eq $branch ) {
Changing it to this removes the warning and seems to be the correct thing to do since the code is checking whether this leg is already in the Via headers and we always add a branch, so any via headers with no branch are not relevant to this check:
if ( exists $param->{branch} and substr( $param->{branch},0,length($branch) ) eq $branch ) {