From 0b12d70a8eef52bc3558406a9f9c781f052f6891 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 24 May 2024 07:55:27 +0000 Subject: [PATCH] Bug 36948: (follow-up) Allow IPv[46] in port config Content-Type: text/plain; charset=utf-8 Signed-off-by: Marcel de Rooy --- C4/SIP/Sip/Configuration.pm | 8 ++++++-- debian/templates/SIPconfig.xml | 4 ++-- etc/SIPconfig.xml | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/C4/SIP/Sip/Configuration.pm b/C4/SIP/Sip/Configuration.pm index 819ec1d486..5c74b124a7 100644 --- a/C4/SIP/Sip/Configuration.pm +++ b/C4/SIP/Sip/Configuration.pm @@ -39,8 +39,8 @@ sub new { my %listeners; # The key to the listeners hash is the 'port' component of the - # configuration, which is of the form '[host]:[port]/proto', and - # the 'proto' component could be upper-, lower-, or mixed-cased. + # configuration, which is of the form '[host]:[port]/proto[/IPv[46]]' + # The 'proto' component could be upper-, lower-, or mixed-cased. # Regularize it here to lower-case, and then do the same below in # find_server() when building the keys to search the hash. @@ -76,6 +76,10 @@ sub find_service { siplog( "LOG_DEBUG", "Configuration::find_service: Trying $portstr" ); last if ( exists( ( $self->{listeners} )->{$portstr} ) ); + $portstr .= '/ipv4'; # lc, see ->new + last if ( exists( ( $self->{listeners} )->{$portstr} ) ); + $portstr .= '/ipv6'; # lc, see ->new + last if ( exists( ( $self->{listeners} )->{$portstr} ) ); } return $self->{listeners}->{$portstr}; } diff --git a/debian/templates/SIPconfig.xml b/debian/templates/SIPconfig.xml index 53b0638802..e79a2950b6 100644 --- a/debian/templates/SIPconfig.xml +++ b/debian/templates/SIPconfig.xml @@ -20,13 +20,13 @@ protocol="NCIP/1.0" /> --> -->