From: Jason Boyer Date: Fri, 6 Sep 2019 12:53:13 +0000 (-0400) Subject: Add a config check to hold phone extention X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d716b0203ecba265172602db91d7769c8d541b3b;p=working%2FSIPServer.git 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 --- 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 ); + } } }