1 <?xml version="1.0" encoding="utf-8"?>
\r
2 <chapter xml:id="sipserver" xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="EN"
\r
3 xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink">
\r
5 <title>SIP Server</title>
\r
7 <para><systemitem class="protocol">SIP</systemitem>, standing for <systemitem class="protocol">Standard Interchange Protocol</systemitem>, was developed by the
\r
8 <orgname class="corporation">3M</orgname>corporation to be a common protocol for data transfer between ILS'
\r
9 (referred to in <systemitem class="protocol">SIP</systemitem> as an <emphasis>ACS</emphasis>, or <emphasis>Automated Circulation System</emphasis>)
\r
10 <indexterm><primary>Automated Circulation System</primary></indexterm> and a
\r
11 third party device. Originally, the protocol was developed for
\r
12 use with 3M SelfCheck (often abbreviated SC, not to be confused with Staff Client) systems, but has since expanded to other companies and devices. It is now common to find
\r
13 <systemitem class="protocol">SIP</systemitem> in use in several other vendors' SelfCheck systems<indexterm><primary>SelfCheck</primary></indexterm>, as well as other non-SelfCheck devices.
\r
14 Some examples include:</para>
\r
16 <listitem>Patron Authentication (computer access, subscription databases)</listitem>
\r
17 <listitem>Automated Material Handling (AMH) <indexterm><primary>Automated Material Handling (AMH)</primary></indexterm>- The automated sorting of items, often to bins or
\r
18 book carts, based on shelving location or other programmable criteria</listitem>
\r
21 <section xml:id="Installing_SIP_Server">
\r
23 <title>Installing the <systemitem class="protocol">SIP</systemitem> Server</title>
\r
25 <para>This is a rough intro to installing the <systemitem class="protocol">SIP</systemitem> server for Evergreen.</para>
\r
26 <simplesect xml:id="Gettingthecode">
\r
27 <title>Getting the code</title>
\r
28 <para>Current <systemitem class="protocol">SIP</systemitem> code lives at github:</para>
\r
29 <screen><userinput>cd /opt</userinput></screen>
\r
30 <screen><userinput>git clone git://github.com/atz/SIPServer.git SIPServer</userinput></screen>
\r
31 <para>Or use the old style:</para>
\r
32 <screen><userinput>$ cd /opt</userinput></screen>
\r
33 <screen><userinput>$ sudo cvs -d:pserver:anonymous@openncip.cvs.sourceforge.net:/cvsroot/openncip login</userinput></screen>
\r
34 <para>When prompted for the CVS password, just hit Enter (sudo password may be req'd)</para>
\r
35 <screen><userinput>$ sudo cvs -z3 -d:pserver:anonymous@openncip.cvs.sourceforge.net:/cvsroot/openncip co -P SIPServer</userinput></screen>
\r
38 <simplesect xml:id="Configuring_Server">
\r
39 <title>Configuring the Server</title>
\r
42 <para>Type the following commands from the command prompt:</para><indexterm><primary>configuration files</primary><secondary>oils_sip.xml</secondary></indexterm>
\r
43 <screen><userinput>$ sudo su opensrf</userinput></screen>
\r
44 <screen><userinput>$ cd /openils/conf</userinput></screen>
\r
45 <screen><userinput>$ cp oils_sip.xml.example oils_sip.xml</userinput></screen>
\r
48 <para>Edit <filename>oils_sip.xml</filename><indexterm><primary>configuration files</primary><secondary>oils_sip.xml</secondary></indexterm>.
\r
49 Change the commented out <server-params> section to this:</para>
\r
53 min_spare_servers='0'
\r
59 <para> max_servers will directly correspond to the number of allowed <systemitem class="protocol">SIP</systemitem> clients. Set the number accordingly, but
\r
60 bear in mind that too many connections can
\r
61 exhaust memory. On a 4G RAM/4 CPU server (that is also running evergreen), it is not recommended to exceed 100
\r
62 <systemitem class="protocol">SIP</systemitem> client connections.</para>
\r
66 <simplesect xml:id="Adding_SIP_users">
\r
67 <title>Adding <systemitem class="protocol">SIP</systemitem> Users</title>
\r
70 <para>Type the following commands from the command prompt:</para><indexterm><primary>configuration files</primary><secondary>oils_sip.xml</secondary></indexterm>
\r
71 <screen><userinput>$ sudo su opensrf</userinput></screen>
\r
72 <screen><userinput>$ cd /openils/conf</userinput></screen>
\r
73 <screen><userinput>$ cp oils_sip.xml.example oils_sip.xml</userinput></screen>
\r
76 <para> in the <accounts> section, add <systemitem class="protocol">SIP</systemitem> client login information. Make sure that all
\r
77 <varname><logins></varname> use the same institution attribute, and make
\r
78 sure the institution is listed in <varname><institutions></varname>. All attributes in the <varname><login></varname> section will be
\r
79 used by the <systemitem class="protocol">SIP</systemitem> client.</para>
\r
83 <para> In Evergreen, create a new profile group called <systemitem class="groupname">SIP</systemitem>.
\r
84 This group should be a sub-group of <systemitem class="groupname">Users</systemitem>
\r
85 (not <systemitem class="groupname">Staff</systemitem> or <systemitem class="groupname">Patrons</systemitem>).
\r
86 Set Editing Permission as <emphasis role="bold">group_application.user.sip_client</emphasis> and give the group the following permissions:</para>
\r
92 VIEW_COPY_CHECKOUT_HISTORY
\r
93 VIEW_PERMIT_CHECKOUT
\r
95 VIEW_USER_FINES_SUMMARY
\r
96 VIEW_USER_TRANSACTIONS
\r
98 <para>OR use SQL like:</para>
\r
101 INSERT INTO permission.grp_tree (id,name,parent,description,application_perm)
\r
102 VALUES (8, 'SIP', 1, 'SIP2 Client Systems', 'group_application.user.sip_client');
\r
104 INSERT INTO permission.grp_perm_map (grp,perm,depth)
\r
105 VALUES (8,15,0),(8,16,0),(8,17,0),(8,31,0),(8,32,0),(8,48,0),(8,54,0),(8,75,0),(8,82,0);
\r
109 <para>Verify:</para>
\r
113 FROM permission.grp_perm_map JOIN permission.perm_list ON
\r
114 permission.grp_perm_map.perm=permission.perm_list.id
\r
119 <para>Keep in mind that the id <emphasis role="bold">(8)</emphasis> may not necessarily be available on your system.</para>
\r
122 <para>For each account created in the <login> section of <filename>oils_sip.xml</filename>, create a user (via the staff client user editor)
\r
123 that has the same username
\r
124 and password and put that user into the <systemitem class="groupname">SIP</systemitem> group.</para>
\r
125 <note><para>The expiration date will affect the <systemitem class="groupname">SIP</systemitem> users' connection so you might want to make a note of
\r
126 this somewhere.</para></note>
\r
130 <simplesect xml:id="Running_SIP_server">
\r
131 <title>Running the server</title>
\r
132 <para>To start the <systemitem class="protocol">SIP</systemitem> server type the following commands from the command prompt:</para>
\r
133 <screen><userinput>$ sudo su opensrf</userinput></screen>
\r
134 <screen><userinput>$ oils_ctl.sh -d /openils/var/run -s /openils/conf/oils_sip.xml -a [start|stop|restart]_sip</userinput></screen>
\r
136 <simplesect xml:id="Logging-SIP">
\r
137 <title>Logging-SIP</title><indexterm><primary>SIP</primary></indexterm>
\r
139 <title><systemitem class="service">Syslog</systemitem></title>
\r
140 <para>It is useful to log <systemitem class="protocol">SIP</systemitem> requests to a separate file especially during initial setup by modifying your
\r
141 syslog config file.</para><indexterm><primary>syslog</primary></indexterm>
\r
144 <para>Edit syslog.conf.</para>
\r
145 <screen><userinput>$ sudo vi /etc/syslog.conf # maybe /etc/rsyslog.conf</userinput></screen>
\r
148 <para>Add this:</para>
\r
149 <programlisting>local6.* -/var/log/SIP_evergreen.log</programlisting>
\r
152 <para><systemitem class="service">Syslog</systemitem> expects the logfile to exist so create the file.</para>
\r
153 <screen><userinput>$ sudo touch /var/log/SIP_evergreen.log</userinput></screen>
\r
156 <para>Restart <systemitem class="service">sysklogd</systemitem>.</para>
\r
157 <screen><userinput>$ sudo /etc/init.d/sysklogd restart</userinput></screen>
\r
162 <title><systemitem class="service">Syslog-NG</systemitem></title>
\r
166 <para>Edit logging config.</para><indexterm><primary>syslog-NG</primary></indexterm>
\r
167 <screen><userinput>sudo vi /etc/syslog-ng/syslog-ng.conf</userinput></screen>
\r
172 # SIP2 for Evergreen
\r
173 filter f_eg_sip { level(warn, err, crit) and facility(local6); };
\r
174 destination eg_sip { file("/var/log/SIP_evergreen.log"); };
\r
175 log { source(s_all); filter(f_eg_sip); destination(eg_sip); };
\r
179 <para><systemitem class="service">Syslog-ng</systemitem> expects the logfile to exist so create the file.</para>
\r
180 <screen><userinput>$ sudo touch /var/log/SIP_evergreen.log</userinput></screen>
\r
183 <para>Restart <systemitem class="service">syslog-ng</systemitem></para>
\r
184 <screen><userinput>$ sudo /etc/init.d/syslog-ng restart</userinput></screen>
\r
189 <simplesect xml:id="Testing_SIP_Connection">
\r
190 <title>Testing Your <systemitem class="protocol">SIP</systemitem> Connection</title><indexterm><primary>SIP</primary></indexterm>
\r
193 <para>In the top level CVS checkout of the SIPServer code.</para>
\r
194 <screen><userinput>$ cd SIPServer/t</userinput></screen>
\r
197 <para> Edit <filename>SIPtest.pm</filename>, change the <varname>$instid</varname>, <varname>$server</varname>, <varname>$username</varname>, and
\r
198 <varname>$password</varname> variables. This will be enough to test connectivity.
\r
199 To run all tests, you'll need to change all the variables in the Configuration section.</para>
\r
200 <screen><userinput>$ PERL5LIB=../ perl 00sc_status.t</userinput></screen>
\r
201 <para>This should produce something like:</para>
\r
204 ok 1 - Invalid username
\r
205 ok 2 - Invalid username
\r
211 <para> Don't be dismayed at <emphasis role="bold">Invalid Username</emphasis>. That's just one of the many tests that are run.</para>
\r
215 <simplesect xml:id="SIP-More_Testing">
\r
216 <title>More Testing</title>
\r
219 <para>Once you have opened up either the <systemitem class="protocol">SIP</systemitem> OR <systemitem class="protocol">SIP2</systemitem> ports to be
\r
220 accessible from outside you can do some testing via <systemitem class="protocol">telnet</systemitem>. You can try this with localhost
\r
221 if you so wish, but we want to prove that <systemitem class="protocol">SIP2</systemitem> works from non-localhost.
\r
222 Replace <varname>$instid</varname>, <varname>$server</varname>, <varname>$barcode</varname>, <varname>$username</varname>,
\r
223 and <varname>$password</varname> variables below as necessary.</para>
\r
224 <note><para>We are using <systemitem>6001</systemitem> here which is associated with <systemitem class="protocol">SIP2</systemitem> as per our configuration.</para></note><indexterm><primary>telnet</primary></indexterm>
\r
226 <userinput>$ telnet $server 6001</userinput>
\r
227 Connected to $server.
\r
228 Escape character is '^]'.
\r
229 <userinput>9300CN**$username**|CO**$password**|CP**$instid**</userinput>
\r
231 <para>You should get back.</para>
\r
232 <screen>941</screen>
\r
235 <para>Now just copy in the following line (with variables replaced) you don't need to hit enter, just paste!</para>
\r
236 <screen>2300120080623 172148AO**$instid**|AA**$barcode**|AC$password|AD**$password**</screen>
\r
237 <para>You will get back the patron information for $barcode (something similar to the what's below).</para>
\r
238 <screen>24 Y 00120100113 170738AEFirstName MiddleName LastName|AA**$barcode**|BLY|CQY|BHUSD|BV0.00|AFOK|AO**$instid**|</screen>
\r
239 <para>The response declares it is a valid patron <varname>BLY</varname> with a valid password <varname>CQY</varname> and shows the user's
\r
240 <varname>$name</varname>.</para>
\r
245 <section xml:id="SIP_Communication">
\r
247 <title><systemitem class="protocol">SIP</systemitem> Communication</title><indexterm><primary>SIP</primary></indexterm>
\r
249 <para><systemitem class="protocol">SIP</systemitem> generally communicates over a <systemitem class="protocol">TCP</systemitem> connection (either raw sockets or over
\r
250 <systemitem class="protocol">telnet</systemitem>), but can also communicate via serial connections and other methods. In Evergreen,
\r
251 the most common deployment is a <systemitem class="protocol">RAW</systemitem> socket connection on port <systemitem>6001</systemitem>.</para>
\r
252 <para><systemitem class="protocol">SIP</systemitem> communication consists of strings of messages, each message request and response begin with a 2-digit
\r
253 <quote>command</quote> - Requests usually being an odd
\r
254 number and responses usually increased by 1 to be an even number. The combination numbers for the request command and response is often referred to as a
\r
255 <emphasis>Message Pair</emphasis> (for example, a 23 command is a request for patron status, a 24 response is a patron status, and the message pair 23/24 is
\r
256 patron status message pair). The table in the next section shows the message pairs and a description of them.</para>
\r
257 <para>For clarification, the <quote>Request</quote> is from the device (selfcheck or otherwise) to the ILS/ACS. The response is… the response
\r
258 to the request ;).</para>
\r
259 <para>Within each request and response, a number of fields (either a fixed width or separated with a <emphasis role="bold">|</emphasis> [pipe symbol] and preceeded with a
\r
260 2-character field identifier)
\r
261 are used. The fields vary between message pairs.</para>
\r
266 <entry>Pair</entry>
\r
267 <entry>Name</entry>
\r
268 <entry>Supported?</entry>
\r
269 <entry>Details</entry>
\r
275 <entry>Block Patron</entry>
\r
277 <entry><link linkend='SIP_Block_Patron'>01_Block_Patron</link> - ACS responds with 24 Patron Status Response</entry>
\r
280 <entry>09/10</entry>
\r
281 <entry>Checkin</entry>
\r
282 <entry>Yes (with extensions)</entry>
\r
283 <entry><link linkend='SIP_Checkin'>09/10_Checkin</link></entry>
\r
286 <entry>11/12</entry>
\r
287 <entry>Checkout</entry>
\r
288 <entry>Yes (no renewals)</entry>
\r
289 <entry><link linkend='SIP_Checkout'>11/12_Checkout</link></entry>
\r
292 <entry>15/16</entry>
\r
293 <entry>Hold</entry>
\r
295 <entry><link linkend='SIP_Hold'>15/16_Hold</link></entry>
\r
298 <entry>17/18</entry>
\r
299 <entry>Item Information</entry>
\r
300 <entry>Yes (no extensions)</entry>
\r
301 <entry><link linkend='SIP_Item_Information'>17/18_Item_Information</link></entry>
\r
304 <entry>19/20</entry>
\r
305 <entry>Item Status Update</entry>
\r
307 <entry><link linkend='SIP_Item_Status_Update'>19/20_Item_Status_Update</link> - Returns Patron Enable response, but doesn't make any changes in EG</entry>
\r
310 <entry>23/24</entry>
\r
311 <entry>Patron Status</entry>
\r
313 <entry><link linkend='SIP_Patron_Status'>23/24_Patron_Status</link> - 63/64 <quote>Patron Information</quote> preferred</entry>
\r
316 <entry>25/26</entry>
\r
317 <entry>Patron Enable</entry>
\r
319 <entry><link linkend='SIP_Patron_Enable'>25/26_Patron_Enable</link> - Used during system testing and validation</entry>
\r
322 <entry>29/30</entry>
\r
323 <entry>Renew</entry>
\r
324 <entry>NO (maybe?)</entry>
\r
325 <entry><link linkend='SIP_Renew'>29/30_Renew</link></entry>
\r
328 <entry>35/36</entry>
\r
329 <entry>End Session</entry>
\r
331 <entry><link linkend='SIP_End_Session'>35/36_End_Session</link></entry>
\r
334 <entry>37/38</entry>
\r
335 <entry>Fee Paid</entry>
\r
337 <entry><link linkend='SIP_Fee_Paid'>37/38_Fee_Paid</link></entry>
\r
340 <entry>63/64</entry>
\r
341 <entry>Patron Information</entry>
\r
342 <entry>Yes (no extensions)</entry>
\r
343 <entry><link linkend='SIP_Patron_Information'>63/64_Patron_Information</link></entry>
\r
346 <entry>65/66</entry>
\r
347 <entry>Renew All</entry>
\r
349 <entry><link linkend='SIP_Renew_All'>65/66_Renew_All</link></entry>
\r
352 <entry>93/94</entry>
\r
353 <entry>Login</entry>
\r
355 <entry><link linkend='SIP_Login'>93/94_Login</link> - Must be first command to Evergreen ACS (via socket) or <systemitem class="protocol">SIP</systemitem> will terminate</entry>
\r
358 <entry>97/96</entry>
\r
359 <entry>Resend last message</entry>
\r
361 <entry><link linkend='SIP_Resend'>97/96_Resend</link></entry>
\r
364 <entry>99/98</entry>
\r
365 <entry>SC/ACS Status</entry>
\r
367 <entry><link linkend='SIP_SC_ACS_Status'>99/98_SC_and_ACS_Status</link></entry>
\r
372 <simplesect xml:id="SIP_Block_Patron">
\r
373 <title>01 Block Patron</title>
\r
374 <para>A selfcheck will issue a <command>Block Patron</command> command if a patron leaves their card in a selfcheck machine or if the selfcheck detects tampering (such as attempts
\r
375 to disable multiple items during a single item checkout, multiple failed pin entries, etc).</para><indexterm><primary>SelfCheck</primary></indexterm>
\r
376 <para>In Evergreen, this command does the following:</para>
\r
378 <listitem>User alert message: <emphasis>CARD BLOCKED BY SELF-CHECK MACHINE</emphasis> (this is independent of the AL
\r
379 <emphasis>Blocked Card Message</emphasis> field).</listitem>
\r
380 <listitem>Card is marked inactive.</listitem>
\r
382 <para>The request looks like:</para>
\r
383 <screen>01<card retained><date>[fields AO, AL, AA, AC]</screen>
\r
384 <para><emphasis>Card Retained</emphasis>: A single character field of <emphasis>Y</emphasis> or <emphasis>N</emphasis> - tells the ACS whether the SC has
\r
385 retained the card (ex: left in the machine) or not.</para>
\r
386 <para><emphasis>Date</emphasis>: An 18 character field for the date/time when the block occurred.</para>
\r
387 <para><emphasis>Format</emphasis>: YYYYMMDDZZZZHHMMSS (ZZZZ being zone - 4 blanks when local time, <quote> Z</quote> (3 blanks and a Z) represents UTC(GMT/Zulu)</para>
\r
388 <para><emphasis>Fields</emphasis>: See <link linkend='SIP_Fields'>Fields</link> for more details.</para>
\r
389 <para>The response is a 24 <quote>Patron Status Response</quote> with the following:</para>
\r
391 <listitem>Charge privileges denied</listitem>
\r
392 <listitem>Renewal privileges denied</listitem>
\r
393 <listitem>Recall privileges denied (hard-coded in every 24 or 64 response)</listitem>
\r
394 <listitem>hold privileges denied</listitem>
\r
395 <listitem>Screen Message 1 (AF): <emphasis>blocked</emphasis></listitem>
\r
396 <listitem>Patron</listitem>
\r
400 <simplesect xml:id="SIP_Checkin">
\r
401 <title>09/10 Checkin</title>
\r
402 <para>The request looks like:</para>
\r
403 <screen>09<No block (Offline)><xact date><return date>[Fields AP,AO,AB,AC,CH,BI]</screen>
\r
404 <para><emphasis>No Block (Offline)</emphasis>: A single character field of <emphasis>Y</emphasis> or <emphasis>N</emphasis> - Offline transactions are not currently
\r
405 supported so send <emphasis>N</emphasis>.</para>
\r
406 <para><emphasis>xact date</emphasis>: an 18 character field for the date/time when the checkin occurred. Format: YYYYMMDDZZZZHHMMSS (ZZZZ being zone -
\r
407 4 blanks when local time, <quote> Z</quote> (3 blanks and a Z) represents UTC(GMT/Zulu)</para>
\r
408 <para><emphasis>Fields</emphasis>: See <link linkend='SIP_Fields'>Fields</link> for more details.</para>
\r
409 <para>The response is a 10 <quote>Checkin Response</quote> with the following:</para>
\r
410 <screen>10<resensitize><magnetic media><alert><xact date>[Fields AO,AB,AQ,AJ,CL,AA,CK,CH,CR,CS,CT,CV,CY,DA,AF,AG]</screen>
\r
411 <para>Example (with a remote hold):</para>
\r
412 <screen>09N20100507 16593720100507 165937APCheckin Bin 5|AOBR1|AB1565921879|ACsip_01|</screen>
\r
413 <screen>101YNY20100623 165731AOBR1|AB1565921879|AQBR1|AJPerl 5 desktop reference|CK001|CSQA76.73.P33V76 1996|CTBR3|CY373827|DANicholas Richard Woodard|CV02|</screen>
\r
414 <para>Here you can see a hold alert for patron <varname>CY</varname> <emphasis>373827</emphasis>, named <varname>DA</varname> <emphasis>Nicholas Richard Woodard</emphasis>,
\r
415 to be picked up at <varname>CT</varname> <quote>BR3</quote>. Since the transaction is happening
\r
416 at <varname>AO</varname> <quote>BR1</quote>, the alert type <varname>CV</varname> is 02 for <emphasis>hold at remote library</emphasis>.
\r
417 The possible values for <varname>CV</varname> are:</para>
\r
419 <listitem>00: unknown</listitem>
\r
420 <listitem>01: local hold</listitem>
\r
421 <listitem>02: remote hold</listitem>
\r
422 <listitem>03: ILL transfer (not used by EG)</listitem>
\r
423 <listitem>04: transfer</listitem>
\r
424 <listitem>99: other</listitem>
\r
427 <para>the logic for Evergreen to determine the content is magnetic_media comes from either legacy circ scripts or search_config_circ_modifier.
\r
428 The default is non-magnetic.<indexterm><primary>magnetic media</primary></indexterm>
\r
429 The same is true for media_type (default 001). Evergreen does not populate the collection_code because it does not really have any, but it will provide the
\r
430 call_number where available.</para>
\r
431 <para>Unlike the <varname>item_id</varname> (barcode), the <varname>title_id</varname> is actually a title string, unless the configuration forces the return of
\r
433 <para>Don't be confused by the different branches that can show up in the same response line.</para>
\r
435 <listitem><varname>AO</varname> is where the transaction took place,</listitem>
\r
436 <listitem><varname>AQ</varname> is the <quote>permanent location</quote>, and</listitem>
\r
437 <listitem><varname>CT</varname> is the <emphasis>destination location</emphasis> (i.e., pickup lib for a hold or target lib for a transfer).</listitem>
\r
441 <simplesect xml:id="SIP_Checkout">
\r
442 <title>11/12 Checkout</title>
\r
444 <simplesect xml:id="SIP_Hold">
\r
445 <title>15/16 Hold</title>
\r
446 <para>Not yet supported.</para>
\r
448 <simplesect xml:id="SIP_Item_Information">
\r
449 <title>17/18 Item Information</title>
\r
450 <para>The request looks like:</para>
\r
451 <screen>17<xact_date>[fields: AO,AB,AC]</screen>
\r
452 <para>The request is very terse. <varname>AC</varname> is optional.</para>
\r
453 <para>The following response structure is for <systemitem class="protocol">SIP2</systemitem>. (Version 1 of the protocol had only 6 total fields.)</para>
\r
454 <screen>18<circulation_status><security_marker><fee_type><xact_date>[fields: CF,AH,CJ,CM,AB,AJ,BG,BH,BV,CK,AQ,AP,CH,AF,AG,+CT,+CS]</screen>
\r
455 <para>Example:</para>
\r
456 <screen>1720060110 215612AOBR1|ABno_such_barcode|</screen>
\r
457 <screen>1801010120100609 162510ABno_such_barcode|AJ|</screen>
\r
458 <screen>1720060110 215612AOBR1|AB1565921879|</screen>
\r
459 <screen>1810020120100623 171415AB1565921879|AJPerl 5 desktop reference|CK001|AQBR1|APBR1|BGBR1|CTBR3|CSQA76.73.P33V76 1996|</screen>
\r
460 <para>The first case is with a bogus barcode. The latter shows an item with a circulation_status of <emphasis>10</emphasis> for <emphasis>in transit between libraries</emphasis>.
\r
461 The known values of <varname>circulation_status</varname> are enumerated in the spec.</para>
\r
462 <para>EXTENSIONS: The <varname>CT</varname> field for <emphasis>destination location</emphasis> and <varname>CS</varname> <emphasis>call number</emphasis> are used by
\r
463 Automated Material Handling systems.</para><indexterm><primary>Automated Material Handling (AMH)</primary></indexterm>
\r
465 <simplesect xml:id="SIP_Item_Status_Update">
\r
466 <title>19/20 Item Status Update</title>
\r
468 <simplesect xml:id="SIP_Patron_Status">
\r
469 <title>23/24 Patron Status</title>
\r
470 <para>Example:</para>
\r
471 <screen>2300120060101 084235AOUWOLS|AAbad_barcode|ACsip_01|ADbad_password|</screen>
\r
472 <screen>24YYYY 00120100507 013934AE|AAbad_barcode|BLN|AOUWOLS|</screen>
\r
473 <screen>2300120060101 084235AOCONS|AA999999|ACsip_01|ADbad_password|</screen>
\r
474 <screen>24 Y 00120100507 022318AEDoug Fiander|AA999999|BLY|CQN|BHUSD|BV0.00|AFOK|AOCONS|</screen>
\r
475 <screen>2300120060101 084235AOCONS|AA999999|ACsip_01|ADuserpassword|LY|CQN|BHUSD|BV0.00|AFOK|AOCONS|</screen>
\r
476 <screen>24 Y 00120100507 022803AEDoug Fiander|AA999999|BLY|CQY|BHUSD|BV0.00|AFOK|AOCONS|</screen>
\r
478 <listitem>The <varname>BL</varname> field (<systemitem class="protocol">SIP2</systemitem>, optional) is <emphasis>valid patron</emphasis>, so the
\r
479 <emphasis>N</emphasis> value means
\r
480 <emphasis>bad_barcode</emphasis> doesn't match a patron, the <emphasis>Y</emphasis> value means 999999 does.</listitem>
\r
481 <listitem>The <varname>CQ</varname> field (<systemitem class="protocol">SIP2</systemitem>, optional) is <emphasis>valid password</emphasis>, so the <emphasis>N</emphasis>
\r
482 value means <emphasis>bad_password</emphasis> doesn't match 999999's password, the <emphasis>Y</emphasis> means <emphasis>userpassword</emphasis>
\r
485 <para>So if you were building the most basic <systemitem class="protocol">SIP2</systemitem> authentication client, you would check for
\r
486 <emphasis>|CQY|</emphasis> in the response to know the user's barcode and password
\r
487 are correct (<varname>|CQY|</varname> implies <varname>|BLY|</varname>, since you cannot check the password unless the barcode exists). However, in practice,
\r
488 depending on the application, there are other factors to consider in authentication, like whether the user is blocked from checkout, owes excessive fines, reported their
\r
489 card lost, etc. These limitations are reflected in the 14-character <emphasis>patron status</emphasis> string immediately following the <emphasis>24</emphasis> code.
\r
490 See the field definitions in your copy of the spec.</para>
\r
492 <simplesect xml:id="SIP_Patron_Enable">
\r
493 <title>25/26 Patron Enable</title>
\r
494 <para>Not yet supported.</para>
\r
496 <simplesect xml:id="SIP_Renew">
\r
497 <title>29/30 Renew</title>
\r
498 <para>Evergreen ACS status message indicates <emphasis>renew</emphasis> is supported.</para>
\r
500 <simplesect xml:id="SIP_End_Session">
\r
501 <title>35/36 End Session</title>
\r
502 <screen>3520100505 115901AOBR1|AA999999|</screen>
\r
503 <screen>36Y20100507 161213AOCONS|AA999999|AFThank you!|</screen>
\r
504 <para>The <emphasis>Y/N</emphasis> code immediately after the 36 indicates <emphasis>success/failure</emphasis>. Failure is not particularly meaningful or
\r
505 important in this context, and for evergreen it is hardcoded <emphasis>Y</emphasis>.</para>
\r
507 <simplesect xml:id="SIP_Fee_Paid">
\r
508 <title>37/38 Fee Paid</title>
\r
509 <para>Not implemented.</para>
\r
511 <simplesect xml:id="SIP_Patron_Information">
\r
512 <title>63/64 Patron Information</title>
\r
513 <para>Attempting to retrieve patron info with a bad barcode:</para>
\r
514 <screen>6300020060329 201700 AOBR1|AAbad_barcode|</screen>
\r
515 <screen>64YYYY 00020100623 141130000000000000000000000000AE|AAbad_barcode|BLN|AOBR1|</screen>
\r
516 <para>Attempting to retrieve patron info with a good barcode (but bad patron password):</para>
\r
517 <screen>6300020060329 201700 AOBR1|AA999999|ADbadpwd|</screen>
\r
518 <screen>64 Y 00020100623 141130000000000000000000000000AA999999|AEDavid J. Fiander|BHUSD|BV0.00|BD2 Meadowvale Dr. St Thomas, ON Canada</screen>
\r
519 <screen>90210|BEdjfiander@somemail.com|BF(519) 555 1234|AQBR1|BLY|CQN|PB19640925|PCPatrons|PIUnfiltered|AFOK|AOBR1|</screen>
\r
520 <para>See <link linkend='SIP_Patron_Status'>23/24 Patron Status</link> for info on <varname>BL</varname> and <varname>CQ</varname> fields.</para>
\r
522 <simplesect xml:id="SIP_Renew_All">
\r
523 <title>65/66 Renew All</title>
\r
524 <para>Not yet supported.</para>
\r
526 <simplesect xml:id="SIP_Login">
\r
527 <title>93/94 Login</title>
\r
528 <para>Example:</para>
\r
529 <screen>9300CNsip_01|CObad_value|CPBR1|</screen>
\r
530 <screen>[Connection closed by foreign host.]</screen>
\r
531 <screen>...</screen>
\r
532 <screen>9300CNsip_01|COsip_01|CPBR1|</screen>
\r
533 <screen>941</screen>
\r
534 <para><emphasis>941</emphasis> means successful terminal login. <emphasis>940</emphasis> or getting dropped means failure.</para>
\r
536 <simplesect xml:id="SIP_Resend">
\r
537 <title>97/96 Resend</title>
\r
539 <simplesect xml:id="SIP_SC_ACS_Status">
\r
540 <title>99/98 SC and ACS Status</title>
\r
541 <screen>99<status code><max print width><protocol version></screen>
\r
542 <para>All 3 fields are required:</para>
\r
544 <listitem>status code - 1 character:</listitem>
\r
546 <listitem>0: SC is OK</listitem>
\r
547 <listitem>1: SC is out of paper</listitem>
\r
548 <listitem>2: SC shutting down</listitem>
\r
550 <listitem>max print width - 3 characters - the integer number of characters the client can print</listitem>
\r
551 <listitem>protocol version - 4 characters - x.xx</listitem>
\r
553 <screen>98<on-line status><checkin ok><checkout ok><ACS renewal policy><status update ok><offline ok><timeout period></screen>
\r
554 <screen><retries allowed><date/time sync><protocol version><institution id><library name><supported messages><terminal</screen>
\r
555 <screen>location><screen message><print line></screen>
\r
556 <para>Example:</para>
\r
557 <screen>9910302.00</screen>
\r
558 <screen>98YYYYNN60000320100510 1717202.00AOCONS|BXYYYYYYYYYNYNNNYN|</screen>
\r
559 <para>The Supported Messages field <varname>BX</varname> appears only in <systemitem class="protocol">SIP2</systemitem>, and specifies whether 16 different
\r
560 <systemitem class="protocol">SIP</systemitem> commands are supported by the ACS or not.</para>
\r
562 <simplesect xml:id="SIP_Fields">
\r
563 <title>Fields</title>
\r
564 <para>All fixed-length fields in a communication will appear before the first variable-length field. This allows for simple parsing. Variable-length fields are by
\r
565 definition delimited, though there will not necessarily be an initial delimiter between the last fixed-length field and the first variable-length one. It would be
\r
566 unnecessary, since you should know the exact position where that field begins already.</para>
\r