From 12e541ed3ca48ea37a7ae0cc2d74b43ce6b72800 Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Fri, 6 Sep 2019 08:53:13 -0400 Subject: [PATCH] LP#1528301: Add a config check to hold phone extention Rather than returning the hold notification phone number on every checkin response, use the phone_ext_to_msg10 institution setting to enable this. Signed-off-by: Jason Boyer Signed-off-by: Martha Driscoll Signed-off-by: Galen Charlton --- SIPconfig.xml | 1 + Sip/Configuration/Institution.pm | 8 ++++++++ Sip/MsgType.pm | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/SIPconfig.xml b/SIPconfig.xml index 2e8d240..a882f41 100644 --- a/SIPconfig.xml +++ b/SIPconfig.xml @@ -81,6 +81,7 @@ retries="3" /> ascii + diff --git a/Sip/Configuration/Institution.pm b/Sip/Configuration/Institution.pm index 6d8c2ef..2ca8a1c 100644 --- a/Sip/Configuration/Institution.pm +++ b/Sip/Configuration/Institution.pm @@ -46,4 +46,12 @@ sub relais_extensions_to_msg24 { ) ? 1 : 0; } +sub phone_ext_to_msg10 { + my $self = shift; + return ( + exists $self->{'phone_ext_to_msg10'} && + $self->{'phone_ext_to_msg10'}->{'enabled'} =~ /true|yes|enabled/i + ) ? 1 : 0; +} + 1; diff --git a/Sip/MsgType.pm b/Sip/MsgType.pm index 2f34858..b04df24 100644 --- a/Sip/MsgType.pm +++ b/Sip/MsgType.pm @@ -708,7 +708,9 @@ sub handle_checkin { $resp .= maybe_add(FID_DESTINATION_LOCATION, $item->destination_loc ); $resp .= maybe_add(FID_HOLD_PATRON_ID, $item->hold_patron_bcode ); $resp .= maybe_add(FID_HOLD_PATRON_NAME, $item->hold_patron_name ); - $resp .= maybe_add(FID_HOME_PHONE, $item->hold_patron_phone ); + if ($server->{institution}->phone_ext_to_msg10()) { + $resp .= maybe_add(FID_HOME_PHONE, $item->hold_patron_phone ); + } } } -- 2.43.2