]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/sip.xml
0d4f7f8a07bb274d8761e3302b4fc7f8c3baf5ff
[working/Evergreen.git] / 1.6 / admin / sip.xml
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
4         <info>\r
5                 <title>SIP Server</title>\r
6         </info>\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
15         <itemizedlist>\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
19         </itemizedlist>\r
20    \r
21         <section xml:id="Installing_SIP_Server">\r
22                 <info>\r
23                 <title>Installing the <systemitem class="protocol">SIP</systemitem> Server</title>\r
24                 </info>\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
36                                                          \r
37                 </simplesect>\r
38                 <simplesect xml:id="Configuring_Server">\r
39                         <title>Configuring the Server</title>\r
40                         <procedure>\r
41                         <step>\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
46                         </step>\r
47                         <step>\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 &lt;server-params&gt; section to this:</para>\r
50 <programlisting>\r
51 &lt;server-params\r
52 min_servers='1'\r
53 min_spare_servers='0'\r
54 max_servers='25'\r
55 /&gt;\r
56 </programlisting>\r
57                         </step>\r
58                         <step>\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
63                         </step>\r
64                         </procedure>             \r
65                 </simplesect>\r
66                 <simplesect xml:id="Adding_SIP_users">\r
67                         <title>Adding <systemitem class="protocol">SIP</systemitem> Users</title>\r
68                         <procedure>\r
69                                 <step>\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
74                                 </step>\r
75                                 <step>\r
76                                         <para> in the &lt;accounts&gt; section, add <systemitem class="protocol">SIP</systemitem> client login information. Make sure that all \r
77                                         <varname>&lt;logins&gt;</varname> use the same institution attribute, and make \r
78                                         sure the institution is listed in <varname>&lt;institutions&gt;</varname>. All attributes in the <varname>&lt;login&gt;</varname> section will be \r
79                                         used by the <systemitem class="protocol">SIP</systemitem> client.</para>\r
80                                 \r
81                                 </step>\r
82                                 <step>\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
87                                         <literallayout>\r
88                                         COPY_CHECKIN\r
89                                         COPY_CHECKOUT\r
90                                         RENEW_CIRC      \r
91                                         VIEW_CIRCULATIONS\r
92                                         VIEW_COPY_CHECKOUT_HISTORY      \r
93                                         VIEW_PERMIT_CHECKOUT\r
94                                         VIEW_USER\r
95                                         VIEW_USER_FINES_SUMMARY\r
96                                         VIEW_USER_TRANSACTIONS\r
97                                         </literallayout>\r
98                                         <para>OR use SQL like:</para>\r
99 <screen>\r
100 <userinput>\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
103 \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
106 </userinput>\r
107 </screen>\r
108                                         \r
109                                         <para>Verify:</para>\r
110 <screen>\r
111 <userinput>\r
112 SELECT *\r
113 FROM permission.grp_perm_map JOIN permission.perm_list ON\r
114 permission.grp_perm_map.perm=permission.perm_list.id\r
115 WHERE grp=8;\r
116 </userinput>\r
117 </screen>\r
118                                         \r
119                                         <para>Keep in mind that the id <emphasis role="bold">(8)</emphasis> may not necessarily be available on your system.</para>                             \r
120                                 </step>\r
121                                 <step>\r
122                                         <para>For each account created in the &lt;login&gt; 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
127                                 </step>\r
128                         </procedure>             \r
129                 </simplesect>\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
135                 </simplesect>\r
136                 <simplesect xml:id="Logging-SIP">\r
137                         <title>Logging-SIP</title><indexterm><primary>SIP</primary></indexterm>\r
138                         <simplesect>\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
142                                 <procedure>\r
143                                         <step>\r
144                                                 <para>Edit syslog.conf.</para>\r
145                                                 <screen><userinput>$ sudo vi /etc/syslog.conf  # maybe /etc/rsyslog.conf</userinput></screen>   \r
146                                         </step>\r
147                                         <step>\r
148                                                 <para>Add this:</para>\r
149                                                 <programlisting>local6.*                -/var/log/SIP_evergreen.log</programlisting>    \r
150                                         </step>\r
151                                         <step>\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
154                                         </step>\r
155                                         <step>\r
156                                                 <para>Restart <systemitem class="service">sysklogd</systemitem>.</para>\r
157                                                 <screen><userinput>$ sudo /etc/init.d/sysklogd restart</userinput></screen>     \r
158                                         </step>\r
159                                 </procedure>            \r
160                         </simplesect>\r
161                         <simplesect>\r
162                                 <title><systemitem class="service">Syslog-NG</systemitem></title>\r
163                                 \r
164                                 <procedure>\r
165                                         <step>\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
168                                         </step>\r
169                                         <step>\r
170                                                 <para>Add:</para>\r
171 <programlisting>\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
176 </programlisting>       \r
177                                         </step>\r
178                                         <step>\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
181                                         </step>\r
182                                         <step>\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
185                                         </step>\r
186                                 </procedure>            \r
187                         </simplesect>\r
188                 </simplesect>   \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
191                         <itemizedlist>\r
192                                 <listitem>\r
193                                         <para>In the top level CVS checkout of the SIPServer code.</para>\r
194                                         <screen><userinput>$ cd SIPServer/t</userinput></screen>\r
195                                 </listitem>\r
196                                 <listitem>\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
202 <screen>\r
203 1..4\r
204 ok 1 - Invalid username\r
205 ok 2 - Invalid username\r
206 ok 3 - login\r
207 ok 4 - SC status\r
208 </screen>\r
209                                 </listitem>     \r
210                                 <listitem>\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
212                                 </listitem>                                             \r
213                         </itemizedlist>\r
214                 </simplesect>\r
215                 <simplesect xml:id="SIP-More_Testing">\r
216                         <title>More Testing</title>\r
217                         <procedure>\r
218                                 <step>\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
225 <screen>\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
230 </screen>                                       \r
231                                         <para>You should get back.</para>\r
232                                         <screen>941</screen>\r
233                                 </step>\r
234                                 <step>\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
241                                 </step>\r
242                         </procedure>\r
243                 </simplesect>\r
244         </section>\r
245         <section xml:id="SIP_Communication">\r
246                 <info>\r
247                         <title><systemitem class="protocol">SIP</systemitem> Communication</title><indexterm><primary>SIP</primary></indexterm>\r
248                 </info>\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
262                 <informaltable>\r
263                         <tgroup cols="4">\r
264                                 <colspec colnum="1" colname="pair" colwidth="0.5*"/>\r
265                                 <colspec colnum="2" colname="name" colwidth="1.0*"/>\r
266                                 <colspec colnum="3" colname="supported" colwidth="1.0*"/>\r
267                                 <colspec colnum="4" colname="details" colwidth="3.0*"/>\r
268                                 <thead>\r
269                                         <row>\r
270                                                 <entry>Pair</entry>\r
271                                                 <entry>Name</entry>\r
272                                                 <entry>Supported?</entry>\r
273                                                 <entry>Details</entry>\r
274                                         </row>\r
275                                 </thead>\r
276                                 <tbody>\r
277                                         <row>\r
278                                                 <entry>01</entry>\r
279                                                 <entry>Block Patron</entry>\r
280                                                 <entry>Yes</entry>\r
281                                                 <entry><link linkend='SIP_Block_Patron'>01_Block_Patron</link> - ACS responds with 24 Patron Status Response</entry>\r
282                                         </row>\r
283                                         <row>\r
284                                                 <entry>09/10</entry>\r
285                                                 <entry>Checkin</entry>\r
286                                                 <entry>Yes (with extensions)</entry>\r
287                                                 <entry><link linkend='SIP_Checkin'>09/10_Checkin</link></entry>\r
288                                         </row>\r
289                                         <row>\r
290                                                 <entry>11/12</entry>\r
291                                                 <entry>Checkout</entry>\r
292                                                 <entry>Yes (no renewals)</entry>\r
293                                                 <entry><link linkend='SIP_Checkout'>11/12_Checkout</link></entry>\r
294                                         </row>\r
295                                         <row>\r
296                                                 <entry>15/16</entry>\r
297                                                 <entry>Hold</entry>\r
298                                                 <entry>No</entry>\r
299                                                 <entry><link linkend='SIP_Hold'>15/16_Hold</link></entry>\r
300                                         </row>\r
301                                         <row>\r
302                                                 <entry>17/18</entry>\r
303                                                 <entry>Item Information</entry>\r
304                                                 <entry>Yes (no extensions)</entry>\r
305                                                 <entry><link linkend='SIP_Item_Information'>17/18_Item_Information</link></entry>\r
306                                         </row>\r
307                                         <row>\r
308                                                 <entry>19/20</entry>\r
309                                                 <entry>Item Status Update</entry>\r
310                                                 <entry>No</entry>\r
311                                                 <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
312                                         </row>\r
313                                         <row>\r
314                                                 <entry>23/24</entry>\r
315                                                 <entry>Patron Status</entry>\r
316                                                 <entry>Yes</entry>\r
317                                                 <entry><link linkend='SIP_Patron_Status'>23/24_Patron_Status</link> - 63/64 <quote>Patron Information</quote> preferred</entry>\r
318                                         </row>\r
319                                         <row>\r
320                                                 <entry>25/26</entry>\r
321                                                 <entry>Patron Enable</entry>\r
322                                                 <entry>No</entry>\r
323                                                 <entry><link linkend='SIP_Patron_Enable'>25/26_Patron_Enable</link> - Used during system testing and validation</entry>\r
324                                         </row>\r
325                                         <row>\r
326                                                 <entry>29/30</entry>\r
327                                                 <entry>Renew</entry>\r
328                                                 <entry>NO (maybe?)</entry>\r
329                                                 <entry><link linkend='SIP_Renew'>29/30_Renew</link></entry>\r
330                                         </row>\r
331                                         <row>\r
332                                                 <entry>35/36</entry>\r
333                                                 <entry>End Session</entry>\r
334                                                 <entry>Yes</entry>\r
335                                                 <entry><link linkend='SIP_End_Session'>35/36_End_Session</link></entry>\r
336                                         </row>\r
337                                         <row>\r
338                                                 <entry>37/38</entry>\r
339                                                 <entry>Fee Paid</entry>\r
340                                                 <entry>No</entry>\r
341                                                 <entry><link linkend='SIP_Fee_Paid'>37/38_Fee_Paid</link></entry>\r
342                                         </row>\r
343                                         <row>\r
344                                                 <entry>63/64</entry>\r
345                                                 <entry>Patron Information</entry>\r
346                                                 <entry>Yes (no extensions)</entry>\r
347                                                 <entry><link linkend='SIP_Patron_Information'>63/64_Patron_Information</link></entry>\r
348                                         </row>\r
349                                         <row>\r
350                                                 <entry>65/66</entry>\r
351                                                 <entry>Renew All</entry>\r
352                                                 <entry>No</entry>\r
353                                                 <entry><link linkend='SIP_Renew_All'>65/66_Renew_All</link></entry>\r
354                                         </row>\r
355                                         <row>\r
356                                                 <entry>93/94</entry>\r
357                                                 <entry>Login</entry>\r
358                                                 <entry>Yes</entry>\r
359                                                 <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
360                                         </row>\r
361                                         <row>\r
362                                                 <entry>97/96</entry>\r
363                                                 <entry>Resend last message</entry>\r
364                                                 <entry>Yes</entry>\r
365                                                 <entry><link linkend='SIP_Resend'>97/96_Resend</link></entry>\r
366                                         </row>\r
367                                         <row>\r
368                                                 <entry>99/98</entry>\r
369                                                 <entry>SC/ACS Status</entry>\r
370                                                 <entry>Yes</entry>\r
371                                                 <entry><link linkend='SIP_SC_ACS_Status'>99/98_SC_and_ACS_Status</link></entry>\r
372                                         </row>\r
373                                 </tbody>\r
374                         </tgroup>\r
375                 </informaltable>\r
376                 <simplesect xml:id="SIP_Block_Patron">\r
377                         <title>01 Block Patron</title>\r
378                         <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
379                         to disable multiple items during a single item checkout, multiple failed pin entries, etc).</para><indexterm><primary>SelfCheck</primary></indexterm>\r
380                         <para>In Evergreen, this command does the following:</para>\r
381                                 <itemizedlist>\r
382                                         <listitem>User alert message: <emphasis>CARD BLOCKED BY SELF-CHECK MACHINE</emphasis> (this is independent of the AL \r
383                                         <emphasis>Blocked Card Message</emphasis> field).</listitem>\r
384                                         <listitem>Card is marked inactive.</listitem>\r
385                                 </itemizedlist>\r
386                         <para>The request looks like:</para>\r
387                         <screen>01&lt;card retained&gt;&lt;date&gt;[fields AO, AL, AA, AC]</screen>\r
388                         <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
389                         retained the card (ex: left in the machine) or not.</para> \r
390                         <para><emphasis>Date</emphasis>: An 18 character field for the date/time when the block occurred.</para> \r
391                         <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
392                         <para><emphasis>Fields</emphasis>: See <link linkend='SIP_Fields'>Fields</link> for more details.</para>\r
393                         <para>The response is a 24 <quote>Patron Status Response</quote> with the following:</para>\r
394                         <itemizedlist>\r
395                                         <listitem>Charge privileges denied</listitem>\r
396                                         <listitem>Renewal privileges denied</listitem>\r
397                                         <listitem>Recall privileges denied (hard-coded in every 24 or 64 response)</listitem>\r
398                                         <listitem>hold privileges denied</listitem>\r
399                                         <listitem>Screen Message 1 (AF): <emphasis>blocked</emphasis></listitem>\r
400                                         <listitem>Patron</listitem>\r
401 \r
402                         </itemizedlist>\r
403                 </simplesect>\r
404                 <simplesect xml:id="SIP_Checkin">\r
405                         <title>09/10 Checkin</title>\r
406                         <para>The request looks like:</para>\r
407                         <screen>09&lt;No block (Offline)&gt;&lt;xact date&gt;&lt;return date&gt;[Fields AP,AO,AB,AC,CH,BI]</screen>\r
408                         <para><emphasis>No Block (Offline)</emphasis>: A single character field of <emphasis>Y</emphasis> or <emphasis>N</emphasis> - Offline transactions are not currently \r
409                         supported so send <emphasis>N</emphasis>.</para> \r
410                         <para><emphasis>xact date</emphasis>: an 18 character field for the date/time when the checkin occurred. Format: YYYYMMDDZZZZHHMMSS (ZZZZ being zone - \r
411                         4 blanks when local time, <quote> Z</quote> (3 blanks and a Z) represents UTC(GMT/Zulu)</para> \r
412                         <para><emphasis>Fields</emphasis>: See <link linkend='SIP_Fields'>Fields</link> for more details.</para>\r
413                         <para>The response is a 10 <quote>Checkin Response</quote> with the following:</para>\r
414                         <screen>10&lt;resensitize>&lt;magnetic media&gt;&lt;alert&gt;&lt;xact date&gt;[Fields AO,AB,AQ,AJ,CL,AA,CK,CH,CR,CS,CT,CV,CY,DA,AF,AG]</screen>\r
415                         <para>Example (with a remote hold):</para>\r
416                         <screen>09N20100507    16593720100507    165937APCheckin Bin 5|AOBR1|AB1565921879|ACsip_01|</screen>\r
417 <screen>\r
418 101YNY20100623    165731AOBR1|AB1565921879|AQBR1|AJPerl 5 desktop reference|CK001|CSQA76.73.P33V76 1996\r
419 |CTBR3|CY373827|DANicholas Richard Woodard|CV02|\r
420 </screen>\r
421                         <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
422                         to be picked up at <varname>CT</varname> <quote>BR3</quote>. Since the transaction is happening \r
423                         at <varname>AO</varname> <quote>BR1</quote>, the alert type <varname>CV</varname> is 02 for <emphasis>hold at remote library</emphasis>. \r
424                         The possible values for <varname>CV</varname> are:</para>\r
425                         <itemizedlist>\r
426                                         <listitem>00: unknown</listitem>\r
427                                         <listitem>01: local hold</listitem>\r
428                                         <listitem>02: remote hold</listitem>\r
429                                         <listitem>03: ILL transfer (not used by EG)</listitem>\r
430                                         <listitem>04: transfer</listitem>\r
431                                         <listitem>99: other</listitem>\r
432                         </itemizedlist>\r
433                         <note>\r
434                                 <para>the logic for Evergreen to determine the content is magnetic_media comes from either legacy circ scripts or search_config_circ_modifier. \r
435                                 The default is non-magnetic.<indexterm><primary>magnetic media</primary></indexterm> \r
436                                 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
437                                 call_number where available.</para>\r
438                                 <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
439                                 the bib ID.</para>\r
440                                 <para>Don't be confused by the different branches that can show up in the same response line.</para>\r
441                                 <itemizedlist>\r
442                                         <listitem><varname>AO</varname> is where the transaction took place,</listitem>\r
443                                         <listitem><varname>AQ</varname> is the <quote>permanent location</quote>, and</listitem>\r
444                                         <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
445                                 </itemizedlist>\r
446                         </note>\r
447                 </simplesect>\r
448                 <simplesect xml:id="SIP_Checkout">\r
449                         <title>11/12 Checkout</title>\r
450                 </simplesect>\r
451                 <simplesect xml:id="SIP_Hold">\r
452                         <title>15/16 Hold</title>\r
453                         <para>Not yet supported.</para>\r
454                 </simplesect>\r
455                 <simplesect xml:id="SIP_Item_Information">\r
456                         <title>17/18 Item Information</title>\r
457                         <para>The request looks like:</para>\r
458                         <screen>17&lt;xact_date&gt;[fields: AO,AB,AC]</screen>\r
459                         <para>The request is very terse. <varname>AC</varname> is optional.</para>\r
460                         <para>The following response structure is for <systemitem class="protocol">SIP2</systemitem>. (Version 1 of the protocol had only 6 total fields.)</para>\r
461                         <screen>18&lt;circulation_status&gt;&lt;security_marker&gt;&lt;fee_type&gt;&lt;xact_date&gt;[fields: CF,AH,CJ,CM,AB,AJ,BG,BH,BV,CK,AQ,AP,CH,AF,AG,+CT,+CS]</screen>\r
462                         <para>Example:</para>\r
463                         <screen>1720060110    215612AOBR1|ABno_such_barcode|</screen>\r
464                         <screen>1801010120100609    162510ABno_such_barcode|AJ|</screen>\r
465                         <screen>1720060110    215612AOBR1|AB1565921879|</screen>\r
466                         <screen>1810020120100623    171415AB1565921879|AJPerl 5 desktop reference|CK001|AQBR1|APBR1|BGBR1|CTBR3|CSQA76.73.P33V76 1996|</screen>\r
467                         <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
468                         The known values of <varname>circulation_status</varname> are enumerated in the spec.</para>\r
469                         <para>EXTENSIONS: The <varname>CT</varname> field for <emphasis>destination location</emphasis> and <varname>CS</varname> <emphasis>call number</emphasis> are used by \r
470                         Automated Material Handling systems.</para><indexterm><primary>Automated Material Handling (AMH)</primary></indexterm>\r
471                 </simplesect>\r
472                 <simplesect xml:id="SIP_Item_Status_Update">\r
473                         <title>19/20 Item Status Update</title>\r
474                 </simplesect>\r
475                 <simplesect xml:id="SIP_Patron_Status">\r
476                         <title>23/24 Patron Status</title>\r
477                         <para>Example:</para>\r
478                         <screen>2300120060101    084235AOUWOLS|AAbad_barcode|ACsip_01|ADbad_password|</screen>\r
479                         <screen>24YYYY          00120100507    013934AE|AAbad_barcode|BLN|AOUWOLS|</screen>\r
480                         <screen>2300120060101    084235AOCONS|AA999999|ACsip_01|ADbad_password|</screen>\r
481                         <screen>24  Y           00120100507    022318AEDoug Fiander|AA999999|BLY|CQN|BHUSD|BV0.00|AFOK|AOCONS|</screen>\r
482                         <screen>2300120060101    084235AOCONS|AA999999|ACsip_01|ADuserpassword|LY|CQN|BHUSD|BV0.00|AFOK|AOCONS|</screen>\r
483                         <screen>24  Y           00120100507    022803AEDoug Fiander|AA999999|BLY|CQY|BHUSD|BV0.00|AFOK|AOCONS|</screen>\r
484                         <orderedlist>\r
485                                 <listitem>The <varname>BL</varname> field (<systemitem class="protocol">SIP2</systemitem>, optional) is <emphasis>valid patron</emphasis>, so the \r
486                                 <emphasis>N</emphasis> value means \r
487                                 <emphasis>bad_barcode</emphasis> doesn't match a patron, the <emphasis>Y</emphasis> value means 999999 does.</listitem>\r
488                                 <listitem>The <varname>CQ</varname> field (<systemitem class="protocol">SIP2</systemitem>, optional) is <emphasis>valid password</emphasis>, so the <emphasis>N</emphasis> \r
489                                 value means <emphasis>bad_password</emphasis> doesn't match 999999's password, the <emphasis>Y</emphasis> means <emphasis>userpassword</emphasis> \r
490                                 does.</listitem>\r
491                         </orderedlist>\r
492                         <para>So if you were building the most basic <systemitem class="protocol">SIP2</systemitem> authentication client, you would check for \r
493                         <emphasis>|CQY|</emphasis> in the response to know the user's barcode and password \r
494                         are correct (<varname>|CQY|</varname> implies <varname>|BLY|</varname>, since you cannot check the password unless the barcode exists). However, in practice, \r
495                         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
496                         card lost, etc. These limitations are reflected in the 14-character <emphasis>patron status</emphasis> string immediately following the <emphasis>24</emphasis> code. \r
497                         See the field definitions in your copy of the spec.</para>\r
498                 </simplesect>\r
499                 <simplesect xml:id="SIP_Patron_Enable">\r
500                         <title>25/26 Patron Enable</title>\r
501                         <para>Not yet supported.</para>\r
502                 </simplesect>\r
503                 <simplesect xml:id="SIP_Renew">\r
504                         <title>29/30 Renew</title>\r
505                         <para>Evergreen ACS status message indicates <emphasis>renew</emphasis> is supported.</para>\r
506                 </simplesect>\r
507                 <simplesect xml:id="SIP_End_Session">\r
508                         <title>35/36 End Session</title>\r
509                         <screen>3520100505    115901AOBR1|AA999999|</screen>\r
510                         <screen>36Y20100507    161213AOCONS|AA999999|AFThank you!|</screen>\r
511                         <para>The <emphasis>Y/N</emphasis> code immediately after the 36 indicates <emphasis>success/failure</emphasis>. Failure is not particularly meaningful or \r
512                         important in this context, and for evergreen it is hardcoded <emphasis>Y</emphasis>.</para>     \r
513                 </simplesect>\r
514                 <simplesect xml:id="SIP_Fee_Paid">\r
515                         <title>37/38 Fee Paid</title>\r
516                         <para>Not implemented.</para>\r
517                 </simplesect>\r
518                 <simplesect xml:id="SIP_Patron_Information">\r
519                         <title>63/64 Patron Information</title>\r
520                         <para>Attempting to retrieve patron info with a bad barcode:</para>\r
521                         <screen>6300020060329    201700          AOBR1|AAbad_barcode|</screen>\r
522                         <screen>64YYYY          00020100623    141130000000000000000000000000AE|AAbad_barcode|BLN|AOBR1|</screen>\r
523                         <para>Attempting to retrieve patron info with a good barcode (but bad patron password):</para>\r
524                         <screen>6300020060329    201700          AOBR1|AA999999|ADbadpwd|</screen>\r
525 <screen>\r
526 64  Y           00020100623    141130000000000000000000000000AA999999|AEDavid J. Fiander|BHUSD|BV0.00\r
527 |BD2 Meadowvale Dr. St Thomas, ON Canada\r
528 </screen>\r
529                         <screen>90210|BEdjfiander@somemail.com|BF(519) 555 1234|AQBR1|BLY|CQN|PB19640925|PCPatrons|PIUnfiltered|AFOK|AOBR1|</screen>\r
530                         <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
531                 </simplesect>\r
532                 <simplesect xml:id="SIP_Renew_All">\r
533                         <title>65/66 Renew All</title>\r
534                         <para>Not yet supported.</para>\r
535                 </simplesect>\r
536                 <simplesect xml:id="SIP_Login">\r
537                         <title>93/94 Login</title>\r
538                         <para>Example:</para>\r
539                         <screen>9300CNsip_01|CObad_value|CPBR1|</screen>\r
540                         <screen>[Connection closed by foreign host.]</screen>\r
541                         <screen>...</screen>\r
542                         <screen>9300CNsip_01|COsip_01|CPBR1|</screen>\r
543                         <screen>941</screen>\r
544                         <para><emphasis>941</emphasis> means successful terminal login. <emphasis>940</emphasis> or getting dropped means failure.</para>\r
545                 </simplesect>\r
546                 <simplesect xml:id="SIP_Resend">\r
547                         <title>97/96 Resend</title>\r
548                 </simplesect>\r
549                 <simplesect xml:id="SIP_SC_ACS_Status">\r
550                         <title>99/98 SC and ACS Status</title>\r
551                         <screen>99&lt;status code&gt;&lt;max print width&gt;&lt;protocol version&gt;</screen>\r
552                         <para>All 3 fields are required:</para>\r
553                         <itemizedlist>\r
554                                         <listitem>status code - 1 character:</listitem>\r
555                                         <itemizedlist>\r
556                                                 <listitem>0: SC is OK</listitem>\r
557                                                 <listitem>1: SC is out of paper</listitem>\r
558                                                 <listitem>2: SC shutting down</listitem>                \r
559                                         </itemizedlist>\r
560                                         <listitem>max print width - 3 characters - the integer number of characters the client can print</listitem>\r
561                                         <listitem>protocol version - 4 characters - x.xx</listitem>\r
562                         </itemizedlist>\r
563                         <screen>98&lt;on-line status&gt;&lt;checkin ok&gt;&lt;checkout ok&gt;&lt;ACS renewal policy&gt;&lt;status update ok&gt;&lt;offline ok&gt;&lt;timeout period&gt;</screen>\r
564                         <screen>&lt;retries allowed&gt;&lt;date/time sync&gt;&lt;protocol version&gt;&lt;institution id&gt;&lt;library name&gt;&lt;supported messages&gt;&lt;terminal</screen> \r
565                         <screen>location&gt;&lt;screen message&gt;&lt;print line&gt;</screen>\r
566                         <para>Example:</para>\r
567                         <screen>9910302.00</screen>\r
568                         <screen>98YYYYNN60000320100510    1717202.00AOCONS|BXYYYYYYYYYNYNNNYN|</screen>\r
569                         <para>The Supported Messages field <varname>BX</varname> appears only in <systemitem class="protocol">SIP2</systemitem>, and specifies whether 16 different \r
570                         <systemitem class="protocol">SIP</systemitem>  commands are supported by the ACS or not.</para>\r
571                 </simplesect>\r
572                 <simplesect xml:id="SIP_Fields">\r
573                         <title>Fields</title>\r
574                         <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
575                         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
576                         unnecessary, since you should know the exact position where that field begins already.</para>\r
577                 </simplesect>\r
578         </section>\r
579 </chapter>\r
580 \r