public function checkInItem($barcode) { global $configArray; //Place the hold via SIP 2 $mysip = new sip2(); $mysip->hostname = $configArray['SIP2']['host']; $mysip->port = $configArray['SIP2']['online_port']; $hold_result['result'] = false; if ($mysip->connect()) { //send selfcheck status message $in = $mysip->msgSCStatus(); $msg_result = $mysip->get_message($in); // Make sure the response is 98 as expected if (preg_match("/^98/", $msg_result)) { $result = $mysip->parseACSStatusResponse($msg_result); // Use result to populate SIP2 setings $mysip->AO = $result['variable']['AO'][0]; /* set AO to value returned */ $mysip->AN = $result['variable']['AN'][0]; /* set AN to value returned */ $mysip->patron = $user->cat_username; $mysip->patronpwd = $user->cat_password; $in = $mysip->msgCheckin($barcode, $mysip->_datestamp()); $msg_result = $mysip->get_message($in); if (preg_match("/^10/", $msg_result)) { $result = $mysip->parseCheckinResponse($msg_result); $checkout_result['result'] = $result['fixed']['Ok'] == 1; $checkout_result['success'] = $checkout_result['result']; $checkout_result['message'] = $result['variable']['AF'][0]; $checkout_result['sipinput'] = $in; $checkout_result['sipresult'] = $result; } } } return $checkout_result; }