Add a config check to hold phone extention user/jboyer/lp1528301_config_check
authorJason Boyer <jboyer@equinoxinitiative.org>
Fri, 6 Sep 2019 12:53:13 +0000 (08:53 -0400)
committerJason Boyer <jboyer@equinoxinitiative.org>
Fri, 6 Sep 2019 19:08:45 +0000 (15:08 -0400)
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 <jboyer@equinoxinitiative.org>
SIPconfig.xml
Sip/Configuration/Institution.pm
Sip/MsgType.pm

index 2e8d240..a882f41 100644 (file)
@@ -81,6 +81,7 @@
                  retries="3" />
           <relais_extensions_to_msg24 enabled="false" />
          <encoding>ascii</encoding>
+         <phone_ext_to_msg10 enabled="false" />
     </institution>
 
     <institution id="LPL" implementation="ILS">
index 6d8c2ef..2ca8a1c 100644 (file)
@@ -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;
index 2f34858..b04df24 100644 (file)
@@ -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  );
+            }
         }
     }