more clean up of some admin files..
[working/Evergreen.git] / 1.6 / admin / sip.xml
1 <?xml version="1.0" encoding="utf-8"?>\r
2 <chapter xml:id="sipserver" xmlns="" version="5.0" xml:lang="EN"\r
3     xmlns:xi="" xmlns: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>cd /opt</screen>\r
30                                 <screen>git clone git:// SIPServer</screen>\r
31                                 <para>Or use the old style:</para>\r
32                                 <screen>$ cd /opt</screen>\r
33                                 <screen>$ sudo cvs login</screen>\r
34                                 <screen># when prompted for the CVS password, just hit Enter (sudo password may be req'd)</screen>\r
35                                 <screen>$ sudo cvs -z3 co -P SIPServer</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>\r
43                                 <screen>$ sudo su opensrf</screen>\r
44                                 <screen>$ cd /openils/conf</screen>\r
45                                 <screen>$ cp oils_sip.xml.example oils_sip.xml</screen>\r
46                         </step>\r
47                         <step>\r
48                                 <para>Edit <filename>oils_sip.xml</filename><indexterm><primary>configuration files</primary><primary>oils_sip.xml</primary></indexterm>. \r
49                                 Change the commented out &lt;server-params&gt; section to this:</para>\r
50                                 <screen>&lt;server-params</screen>\r
51                                 <screen>min_servers='1'</screen>\r
52                                 <screen>min_spare_servers='0'</screen>\r
53                                 <screen>max_servers='25'</screen>\r
54                                 <screen>/&gt;</screen>\r
55                         </step>\r
56                         <step>\r
57                                 <para> max_servers will directly correspond to the number of allowed <systemitem class="protocol">SIP</systemitem> clients. Set the number accordingly, but \r
58                                 bear in mind that too many connections can \r
59                                 exhaust memory. On a 4G RAM/4 CPU server (that is also running evergreen), I would recommend not exceeding 100 \r
60                                 <systemitem class="protocol">SIP</systemitem> client connections, \r
61                                 give or take.</para>                            \r
62                         </step>\r
63                         </procedure>             \r
64                 </simplesect>\r
65                 <simplesect xml:id="Adding_SIP_users">\r
66                         <title>Adding <systemitem class="protocol">SIP</systemitem> Users</title>\r
67                         <procedure>\r
68                                 <step>\r
69                                         <para>Type the following commands from the command prompt:</para>\r
70                                         <screen>$ sudo su opensrf</screen>\r
71                                         <screen>$ cd /openils/conf</screen>\r
72                                         <screen>$ cp oils_sip.xml.example oils_sip.xml</screen>\r
73                                 </step>\r
74                                 <step>\r
75                                         <para> in the &lt;accounts&gt; section, add <systemitem class="protocol">SIP</systemitem> client login information. Make sure that all &lt;logins&gt; use the \r
76                                         same institution attribute, and make \r
77                                         sure the institution is listed in &lt;institutions&gt;. All attributes in the &lt;login&gt; section will be used by the <systemitem class="protocol">SIP</systemitem> client.</para>\r
78                                 \r
79                                 </step>\r
80                                 <step>\r
81                                         <para> In Evergreen, create a new profile group called <systemitem class="protocol">SIP</systemitem>. This group should be a sub-group of Users \r
82                                         (not Staff or Patrons). \r
83                                         Set Editing Permission as <emphasis>group_application.user.sip_client</emphasis> and give the group the following permissions:</para>\r
84                                         <literallayout>\r
85                                         COPY_CHECKIN\r
86                                         COPY_CHECKOUT\r
87                                         RENEW_CIRC      \r
88                                         VIEW_CIRCULATIONS\r
89                                         VIEW_COPY_CHECKOUT_HISTORY      \r
90                                         VIEW_PERMIT_CHECKOUT\r
91                                         VIEW_USER\r
92                                         VIEW_USER_FINES_SUMMARY\r
93                                         VIEW_USER_TRANSACTIONS\r
94                                         </literallayout>\r
95                                         <para>OR use SQL like:</para>\r
96                                         <screen>INSERT INTO permission.grp_tree (id,name,parent,description,application_perm)</screen> \r
97                                         <screen>VALUES (8, 'SIP', 1, 'SIP2 Client Systems', 'group_application.user.sip_client');</screen>\r
98                                         <screen></screen>\r
99                                         <screen>INSERT INTO permission.grp_perm_map (grp,perm,depth) </screen>\r
100                                         <screen>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);</screen>\r
101                                         \r
102                                         <para>Verify:</para>\r
103                                         <screen>SELECT *</screen>\r
104                                         <screen>FROM permission.grp_perm_map JOIN permission.perm_list ON</screen> \r
105                                         <screen></screen> \r
106                                         <screen>WHERE grp=8;</screen>\r
107                                         \r
108                                         <para>Keep in mind that the id (8) may not necessarily be available on your system.</para>                              \r
109                                 </step>\r
110                                 <step>\r
111                                         <para>For each account created in the &lt;login&gt; section of oils_sip.xml, create a user (via the staff client user editor) that has the same username \r
112                                         and password and put that user into the <systemitem class="protocol">SIP</systemitem> group.</para>\r
113                                         <note><para>The expiration date will affect the <systemitem class="protocol">SIP</systemitem> users' connection, you might want to make a note of \r
114                                         this somewhere. </para></note>  \r
115                                 </step>\r
116                         </procedure>             \r
117                 </simplesect>\r
118                 <simplesect xml:id="Running_SIP_server">\r
119                         <title>Running the server</title>\r
120                                 <para>To start the <systemitem class="protocol">SIP</systemitem> server type the following commands from the command prompt:</para>\r
121                                 <screen>$ sudo su opensrf</screen>\r
122                                 <screen>$ -d /openils/var/run -s /openils/conf/oils_sip.xml -a [start|stop|restart]_sip</screen>    \r
123                 </simplesect>\r
124                 <simplesect xml:id="Logging-SIP">\r
125                         <title>Logging-SIP</title>\r
126                         <simplesect>\r
127                                 <title>Syslog</title>\r
128                                 <para>It is useful to log <systemitem class="protocol">SIP</systemitem> requests to a separate file especially during initial setup by modifying your syslog config file.</para>\r
129                                 <procedure>\r
130                                         <step>\r
131                                                 <para>Edit syslog.conf.</para>\r
132                                                 <screen>$ sudo vi /etc/syslog.conf  # maybe /etc/rsyslog.conf</screen>  \r
133                                         </step>\r
134                                         <step>\r
135                                                 <para>Add this:</para>\r
136                                                 <screen>local6.*                -/var/log/SIP_evergreen.log</screen>    \r
137                                         </step>\r
138                                         <step>\r
139                                                 <para>Syslog expects the logfile to exist so create the file.</para>\r
140                                                 <screen>$ sudo touch /var/log/SIP_evergreen.log</screen>        \r
141                                         </step>\r
142                                         <step>\r
143                                                 <para>Restart sysklogd.</para>\r
144                                                 <screen>$ sudo /etc/init.d/sysklogd restart</screen>    \r
145                                         </step>\r
146                                 </procedure>            \r
147                         </simplesect>\r
148                         <simplesect>\r
149                                 <title>Syslog-NG</title>\r
150                                 \r
151                                 <procedure>\r
152                                         <step>\r
153                                                 <para>Edit logging config.</para>\r
154                                                 <screen>sudo vi /etc/syslog-ng/syslog-ng.conf</screen>  \r
155                                         </step>\r
156                                         <step>\r
157                                                 <para>Add:</para>\r
158                                                 <screen># SIP2 for Evergreen</screen>   \r
159                                                 <screen>filter    f_eg_sip { level(warn, err, crit) and facility(local6); };</screen>   \r
160                                                 <screen>destination eg_sip { file("/var/log/SIP_evergreen.log"); };</screen>    \r
161                                                 <screen>log { source(s_all); filter(f_eg_sip); destination(eg_sip); };</screen> \r
162                                         </step>\r
163                                         <step>\r
164                                                 <para>Syslog-ng expects the logfile to exist so create the file.</para>\r
165                                                 <screen>$ sudo touch /var/log/SIP_evergreen.log</screen>        \r
166                                         </step>\r
167                                         <step>\r
168                                                 <para>Restart syslog-ng</para>\r
169                                                 <screen>$ sudo /etc/init.d/syslog-ng restart\r
170                                                 </screen>       \r
171                                         </step>\r
172                                 </procedure>            \r
173                         </simplesect>\r
174                 </simplesect>   \r
175                 <simplesect xml:id="Testing_SIP_Connection">\r
176                         <title>Testing Your <systemitem class="protocol">SIP</systemitem> Connection</title>\r
177                         <itemizedlist>\r
178                                 <listitem>\r
179                                         <para>In the top level CVS checkout of the SIPServer code.</para>\r
180                                         <screen>$ cd SIPServer/t</screen>\r
181                                 </listitem>\r
182                                 <listitem>\r
183                                         <para> Edit, change the $instid, $server, $username, and $password variables. This will be enough to test connectivity. \r
184                                         To run all tests, you'll need to change all the variables in the Configuration section.</para>\r
185                                         <screen>$ PERL5LIB=../ perl 00sc_status.t</screen>\r
186                                         <para>This should produce something like:</para>\r
187                                         <screen>1..4</screen>\r
188                                         <screen>ok 1 - Invalid username</screen>\r
189                                         <screen>ok 2 - Invalid username</screen>\r
190                                         <screen>ok 3 - login</screen>\r
191                                         <screen>ok 4 - SC status</screen>\r
192                                 </listitem>     \r
193                                 <listitem>\r
194                                         <para> Don't be dismayed at “Invalid Username”. That's just one of the many tests that are run.</para>\r
195                                 </listitem>                                             \r
196                         </itemizedlist>\r
197                 </simplesect>\r
198                 <simplesect xml:id="SIP-More_Testing">\r
199                         <title>More Testing</title>\r
200                         <procedure>\r
201                                 <step>\r
202                                         <para>Once you have opened up either the <systemitem class="protocol">SIP</systemitem> OR <systemitem class="protocol">SIP2</systemitem> ports to be accessible from outside you can do some testing via telnet. You can try this with localhost \r
203                                         if you so wish, but we want to prove that <systemitem class="protocol">SIP2</systemitem> works from non-localhost. Replace $instid, $server, $barcode, $username, and $password variables below as \r
204                                         necessary.</para>\r
205                                         <note><para>We are using 6001 here which is associated with <systemitem class="protocol">SIP2</systemitem> as per our configuration.</para></note>\r
206                                         <screen>$ telnet $server 6001</screen>\r
207                                         <screen>Connected to $server.</screen>\r
208                                         <screen>Escape character is '^]'.</screen>\r
209                                         <screen>9300CN**$username**|CO**$password**|CP**$instid**</screen>                                      \r
210                                         <para>You should get back.</para>\r
211                                         <screen>941</screen>\r
212                                 </step>\r
213                                 <step>\r
214                                         <para>Now just copy in the following line (with variables replaced) you don't need to hit enter, just paste!</para>\r
215                                         <screen>2300120080623    172148AO**$instid**|AA**$barcode**|AC$password|AD**$password**</screen>\r
216                                         <para>You will get back the patron information for $barcode (something similar to the what's below).</para>\r
217                                         <screen>24  Y           00120100113    170738AEFirstName MiddleName LastName|AA**$barcode**|BLY|CQY|BHUSD|BV0.00|AFOK|AO**$instid**|</screen>\r
218                                         <para>The response declares it is a valid patron <emphasis>(BLY)</emphasis> with a valid password <emphasis>(CQY)</emphasis> and shows the user's <emphasis>$name</emphasis>.</para>\r
219                                 </step>\r
220                         </procedure>\r
221                 </simplesect>\r
222         </section>\r
223         <section xml:id="SIP_Communication">\r
224                 <info>\r
225                         <title><systemitem class="protocol">SIP</systemitem> Communication</title>\r
226                 </info>\r
227                 <para><systemitem class="protocol">SIP</systemitem> generally communicates over a TCP connection (either raw sockets or over telnet), but can also communicate via serial connections and other methods. In Evergreen, \r
228                 the most common deployment is a RAW socket connection on port 6001.</para>\r
229                 <para>SIP communication consists of strings of messages, each message request and response begin with a 2-digit <quote>command</quote> - Requests usually being an odd \r
230                 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
231                 <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
232                 patron status message pair). The table in the next section shows the message pairs and a description of them.</para>\r
233                 <para>For clarification, the <quote>Request</quote> is from the device (selfcheck or otherwise) to the ILS/ACS. The response is… the response \r
234                 to the request ;).</para>\r
235                 <para>Within each request and response, a number of fields (either a fixed width or separated with a '|' [pipe symbol] and preceeded with a 2-character field identifier) \r
236                 are used. The fields vary between message pairs.</para>\r
237                 <informaltable>\r
238                         <tgroup cols="4">\r
239                                 <thead>\r
240                                         <row>\r
241                                                 <entry>Pair</entry>\r
242                                                 <entry>Name</entry>\r
243                                                 <entry>Supported?</entry>\r
244                                                 <entry>Details</entry>\r
245                                         </row>\r
246                                 </thead>\r
247                                 <tbody>\r
248                                         <row>\r
249                                                 <entry>01</entry>\r
250                                                 <entry>Block Patron</entry>\r
251                                                 <entry>Yes</entry>\r
252                                                 <entry><link linkend='SIP_Block_Patron'>01_Block_Patron</link> - ACS responds with 24 Patron Status Response</entry>\r
253                                         </row>\r
254                                         <row>\r
255                                                 <entry>09/10</entry>\r
256                                                 <entry>Checkin</entry>\r
257                                                 <entry>Yes (with extensions)</entry>\r
258                                                 <entry><link linkend='SIP_Checkin'>09/10_Checkin</link></entry>\r
259                                         </row>\r
260                                         <row>\r
261                                                 <entry>11/12</entry>\r
262                                                 <entry>Checkout</entry>\r
263                                                 <entry>Yes (no renewals)</entry>\r
264                                                 <entry><link linkend='SIP_Checkout'>11/12_Checkout</link></entry>\r
265                                         </row>\r
266                                         <row>\r
267                                                 <entry>15/16</entry>\r
268                                                 <entry>Hold</entry>\r
269                                                 <entry>No</entry>\r
270                                                 <entry><link linkend='SIP_Hold'>15/16_Hold</link></entry>\r
271                                         </row>\r
272                                         <row>\r
273                                                 <entry>17/18</entry>\r
274                                                 <entry>Item Information</entry>\r
275                                                 <entry>Yes (no extensions)</entry>\r
276                                                 <entry><link linkend='SIP_Item_Information'>17/18_Item_Information</link></entry>\r
277                                         </row>\r
278                                         <row>\r
279                                                 <entry>19/20</entry>\r
280                                                 <entry>Item Status Update</entry>\r
281                                                 <entry>No</entry>\r
282                                                 <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
283                                         </row>\r
284                                         <row>\r
285                                                 <entry>23/24</entry>\r
286                                                 <entry>Patron Status</entry>\r
287                                                 <entry>Yes</entry>\r
288                                                 <entry><link linkend='SIP_Patron_Status'>23/24_Patron_Status</link> - 63/64 <quote>Patron Information</quote> preferred</entry>\r
289                                         </row>\r
290                                         <row>\r
291                                                 <entry>25/26</entry>\r
292                                                 <entry>Patron Enable</entry>\r
293                                                 <entry>No</entry>\r
294                                                 <entry><link linkend='SIP_Patron_Enable'>25/26_Patron_Enable</link> - Used during system testing and validation</entry>\r
295                                         </row>\r
296                                         <row>\r
297                                                 <entry>29/30</entry>\r
298                                                 <entry>Renew</entry>\r
299                                                 <entry>NO (maybe?)</entry>\r
300                                                 <entry><link linkend='SIP_Renew'>29/30_Renew</link></entry>\r
301                                         </row>\r
302                                         <row>\r
303                                                 <entry>35/36</entry>\r
304                                                 <entry>End Session</entry>\r
305                                                 <entry>Yes</entry>\r
306                                                 <entry><link linkend='SIP_End_Session'>35/36_End_Session</link></entry>\r
307                                         </row>\r
308                                         <row>\r
309                                                 <entry>37/38</entry>\r
310                                                 <entry>Fee Paid</entry>\r
311                                                 <entry>No</entry>\r
312                                                 <entry><link linkend='SIP_Fee_Paid'>37/38_Fee_Paid</link></entry>\r
313                                         </row>\r
314                                         <row>\r
315                                                 <entry>63/64</entry>\r
316                                                 <entry>Patron Information</entry>\r
317                                                 <entry>Yes (no extensions)</entry>\r
318                                                 <entry><link linkend='SIP_Patron_Information'>63/64_Patron_Information</link></entry>\r
319                                         </row>\r
320                                         <row>\r
321                                                 <entry>65/66</entry>\r
322                                                 <entry>Renew All</entry>\r
323                                                 <entry>No</entry>\r
324                                                 <entry><link linkend='SIP_Renew_All'>65/66_Renew_All</link></entry>\r
325                                         </row>\r
326                                         <row>\r
327                                                 <entry>93/94</entry>\r
328                                                 <entry>Login</entry>\r
329                                                 <entry>Yes</entry>\r
330                                                 <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
331                                         </row>\r
332                                         <row>\r
333                                                 <entry>97/96</entry>\r
334                                                 <entry>Resend last message</entry>\r
335                                                 <entry>Yes</entry>\r
336                                                 <entry><link linkend='SIP_Resend'>97/96_Resend</link></entry>\r
337                                         </row>\r
338                                         <row>\r
339                                                 <entry>99/98</entry>\r
340                                                 <entry>SC/ACS Status</entry>\r
341                                                 <entry>Yes</entry>\r
342                                                 <entry><link linkend='SIP_SC_ACS_Status'>99/98_SC_and_ACS_Status</link></entry>\r
343                                         </row>\r
344                                 </tbody>\r
345                         </tgroup>\r
346                 </informaltable>\r
347                 <simplesect xml:id="SIP_block_patron">\r
348                         <title>01 Block Patron</title>\r
349                         <para>A selfcheck will issue a Block Patron command if a patron leaves their card in a selfcheck machine or if the selfcheck detects tampering (such as attempts \r
350                         to disable multiple items during a single item checkout, multiple failed pin entries, etc).</para>\r
351                         <para>In Evergreen, this command does the following:</para>\r
352                                 <itemizedlist>\r
353                                         <listitem>User alert message: 'CARD BLOCKED BY SELF-CHECK MACHINE' (this is independent of the AL 'Blocked Card Message' field).</listitem>\r
354                                         <listitem>Card is marked inactive.</listitem>\r
355                                 </itemizedlist>\r
356                         <para>The request looks like:</para>\r
357                         <screen>01&lt;card retained&gt;&lt;date&gt;[fields AO, AL, AA, AC]</screen>\r
358                         <para><emphasis>Card Retained</emphasis>: A single character field of 'Y' or 'N' - tells the ACS whether the SC has retained the card (ex: left in the machine) or not.</para> \r
359                         <para><emphasis>Date</emphasis>: An 18 character field for the date/time when the block occurred.</para> \r
360                         <para><emphasis>Format</emphasis>: YYYYMMDDZZZZHHMMSS (ZZZZ being zone - 4 blanks when 'local time', ' Z' (3 blanks and a Z) represents UTC(GMT/Zulu)</para>\r
361                         <para><emphasis>Fields</emphasis>: See <link linkend='SIP_Fields'>Fields</link> for more details.</para>\r
362                         <para>The response is a 24 “Patron Status Response” with the following:</para>\r
363                         <itemizedlist>\r
364                                         <listitem>Charge privileges denied</listitem>\r
365                                         <listitem>Renewal privileges denied</listitem>\r
366                                         <listitem>Recall privileges denied (hard-coded in every 24 or 64 response)</listitem>\r
367                                         <listitem>hold privileges denied</listitem>\r
368                                         <listitem>Screen Message 1 (AF): 'blocked'</listitem>\r
369                                         <listitem>Patron</listitem>\r
370 \r
371                         </itemizedlist>\r
372                 </simplesect>\r
373                 <simplesect xml:id="SIP_Checkin">\r
374                         <title>09/10 Checkin</title>\r
375                         <para>The request looks like:</para>\r
376                         <screen>09&lt;No block (Offline)&gt;&lt;xact date&gt;&lt;return date&gt;[Fields AP,AO,AB,AC,CH,BI]</screen>\r
377                         <para><emphasis>No Block (Offline)</emphasis>: A single character field of 'Y' or 'N' - Offline transactions are not currently supported so send 'N'.</para> \r
378                         <para><emphasis>xact date</emphasis>: an 18 character field for the date/time when the checkin occurred. Format: YYYYMMDDZZZZHHMMSS (ZZZZ being zone - \r
379                         4 blanks when 'local time', ' Z' (3 blanks and a Z) represents UTC(GMT/Zulu)</para> \r
380                         <para><emphasis>Fields</emphasis>: See <link linkend='SIP_Fields'>Fields</link> for more details.</para>\r
381                         <para>The response is a 10 <quote>Checkin Response</quote> with the following:</para>\r
382                         <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
383                         <para>Example (with a remote hold):</para>\r
384                         <screen>09N20100507    16593720100507    165937APCheckin Bin 5|AOBR1|AB1565921879|ACsip_01|</screen>\r
385                         <screen>101YNY20100623    165731AOBR1|AB1565921879|AQBR1|AJPerl 5 desktop reference|CK001|CSQA76.73.P33V76 1996|CTBR3|CY373827|DANicholas Richard Woodard|CV02|</screen>\r
386                         <para>Here you can see a hold alert for patron (CY) 373827, named (DA) Nicholas Richard Woodard, to be picked up at (CT) BR3. Since the transaction is happening \r
387                         at (AO) BR1, the alert type (CV) is 02 for “hold at remote library”. The possible values for CV are:</para>\r
388                         <itemizedlist>\r
389                                         <listitem>00: unknown</listitem>\r
390                                         <listitem>01: local hold</listitem>\r
391                                         <listitem>02: remote hold</listitem>\r
392                                         <listitem>03: ILL transfer (not used by EG)</listitem>\r
393                                         <listitem>04: transfer</listitem>\r
394                                         <listitem>99: other</listitem>\r
395                         </itemizedlist>\r
396                         <note>\r
397                                 <para>the logic for EG to determine the content is magnetic_media comes from either legacy circ scripts or search_config_circ_modifier. The default is non-magnetic. \r
398                                 The same is true for media_type (default 001). EG does not populate the collection_code because it does not really have any, but it will provide the call_number where \r
399                                 available.</para>\r
400                                 <para>Unlike the item_id (barcode), the title_id is actually a title string, unless the configuration forces the return of the bib ID.</para>\r
401                                 <para>Don't be confused by the different branches that can show up in the same response line.</para>\r
402                                 <itemizedlist>\r
403                                         <listitem>AO is where the transaction took place,</listitem>\r
404                                         <listitem>AQ is the <quote>permanent location</quote>, and</listitem>\r
405                                         <listitem>CT is the <quote>destination location</quote> (i.e., pickup lib for a hold or target lib for a transfer).</listitem>\r
406                                 </itemizedlist>\r
407                         </note>\r
408                 </simplesect>\r
409                 <simplesect xml:id="SIP_Checkout">\r
410                         <title>11/12 Checkout</title>\r
411                 </simplesect>\r
412                 <simplesect xml:id="SIP_Hold">\r
413                         <title>15/16 Hold</title>\r
414                         <para>Not yet supported.</para>\r
415                 </simplesect>\r
416                 <simplesect xml:id="SIP_Item_Information">\r
417                         <title>17/18 Item Information</title>\r
418                         <para>The request looks like:</para>\r
419                         <screen>17&lt;xact_date&gt;[fields: AO,AB,AC]</screen>\r
420                         <para>The request is very terse. AC is optional.</para>\r
421                         <para>The following response structure is for <systemitem class="protocol">SIP2</systemitem>. (Version 1 of the protocol had only 6 total fields.)</para>\r
422                         <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
423                         <para>Example:</para>\r
424                         <screen>1720060110    215612AOBR1|ABno_such_barcode|</screen>\r
425                         <screen>1801010120100609    162510ABno_such_barcode|AJ|</screen>\r
426                         <screen>1720060110    215612AOBR1|AB1565921879|</screen>\r
427                         <screen>1810020120100623    171415AB1565921879|AJPerl 5 desktop reference|CK001|AQBR1|APBR1|BGBR1|CTBR3|CSQA76.73.P33V76 1996|</screen>\r
428                         <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
429                         The known values of circulation_status are enumerated in the spec.</para>\r
430                         <para>EXTENSIONS: The <emphasis>CT</emphasis> field for <emphasis>destination location</emphasis> and CS <emphasis>call number</emphasis> are used by Automated Material \r
431                         Handling systems.</para>\r
432                 </simplesect>\r
433                 <simplesect xml:id="SIP_Item_Status_Update">\r
434                         <title>19/20 Item Status Update</title>\r
435                 </simplesect>\r
436                 <simplesect xml:id="SIP_Patron_Status">\r
437                         <title>23/24 Patron Status</title>\r
438                         <para>Example:</para>\r
439                         <screen>2300120060101    084235AOUWOLS|AAbad_barcode|ACsip_01|ADbad_password|</screen>\r
440                         <screen>24YYYY          00120100507    013934AE|AAbad_barcode|BLN|AOUWOLS|</screen>\r
441                         <screen>2300120060101    084235AOCONS|AA999999|ACsip_01|ADbad_password|</screen>\r
442                         <screen>24  Y           00120100507    022318AEDoug Fiander|AA999999|BLY|CQN|BHUSD|BV0.00|AFOK|AOCONS|</screen>\r
443                         <screen>2300120060101    084235AOCONS|AA999999|ACsip_01|ADuserpassword|LY|CQN|BHUSD|BV0.00|AFOK|AOCONS|</screen>\r
444                         <screen>24  Y           00120100507    022803AEDoug Fiander|AA999999|BLY|CQY|BHUSD|BV0.00|AFOK|AOCONS|</screen>\r
445                         <orderedlist>\r
446                                 <listitem>The <emphasis>BL</emphasis> field (<systemitem class="protocol">SIP2</systemitem>, optional) is <emphasis>valid patron</emphasis>, so the <emphasis>N</emphasis> value means \r
447                                 <emphasis>bad_barcode</emphasis> doesn't match a patron, the <emphasis>Y</emphasis> value means 999999 does.</listitem>\r
448                                 <listitem>The <emphasis>CQ</emphasis> field (<systemitem class="protocol">SIP2</systemitem>, optional) is <emphasis>valid password</emphasis>, so the <emphasis>N</emphasis> \r
449                                 value means <emphasis>bad_password</emphasis> doesn't match 999999's password, the <emphasis>Y</emphasis> means <emphasis>userpassword</emphasis> \r
450                                 does.</listitem>\r
451                         </orderedlist>\r
452                         <para>So if you were building the most basic <systemitem class="protocol">SIP2</systemitem> authentication client, you would check for <emphasis>|CQY|</emphasis> in the response to know the user's barcode and password \r
453                         are correct (<emphasis>|CQY|</emphasis> implies <emphasis>|BLY|</emphasis>, since you cannot check the password unless the barcode exists). However, in practice, \r
454                         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
455                         card lost, etc. These limitations are reflected in the 14-character <emphasis>patron status</emphasis> string immediately following the <emphasis>24</emphasis> code. \r
456                         See the field definitions in your copy of the spec.</para>\r
457                 </simplesect>\r
458                 <simplesect xml:id="SIP_Patron_Enable">\r
459                         <title>25/26 Patron Enable</title>\r
460                         <para>Not yet supported.</para>\r
461                 </simplesect>\r
462                 <simplesect xml:id="sip_Renew">\r
463                         <title>29/30 Renew</title>\r
464                         <para>EG ACS status message indicates Renew is supported.</para>\r
465                 </simplesect>\r
466                 <simplesect xml:id="SIP_End_Session">\r
467                         <title>35/36 End Session</title>\r
468                         <screen>3520100505    115901AOBR1|AA999999|</screen>\r
469                         <screen>36Y20100507    161213AOCONS|AA999999|AFThank you!|</screen>\r
470                         <para>The Y/N code immediately after the 36 indicates success/failure. Failure is not particularly meaningful or important in this context, and for evergreen it \r
471                         is hardcoded Y.</para>  \r
472                 </simplesect>\r
473                 <simplesect xml:id="SIP_Fee_Paid">\r
474                         <title>37/38 Fee Paid</title>\r
475                         <para>Not implemented.</para>\r
476                 </simplesect>\r
477                 <simplesect xml:id="SIP_Patron_Information">\r
478                         <title>63/64 Patron Information</title>\r
479                         <para>Attempting to retrieve patron info with a bad barcode:</para>\r
480                         <screen>6300020060329    201700          AOBR1|AAbad_barcode|</screen>\r
481                         <screen>64YYYY          00020100623    141130000000000000000000000000AE|AAbad_barcode|BLN|AOBR1|</screen>\r
482                         <para>Attempting to retrieve patron info with a good barcode (but bad patron password):</para>\r
483                         <screen>6300020060329    201700          AOBR1|AA999999|ADbadpwd|</screen>\r
484                         <screen>64  Y           00020100623    141130000000000000000000000000AA999999|AEDavid J. Fiander|BHUSD|BV0.00|BD2 Meadowvale Dr. St Thomas, ON Canada</screen>\r
485                         <screen>90210||BF(519) 555 1234|AQBR1|BLY|CQN|PB19640925|PCPatrons|PIUnfiltered|AFOK|AOBR1|</screen>\r
486                         <para>See <link linkend='SIP_Patron_Status'>23/24 Patron Status</link> for info on <emphasis>BL</emphasis> and <emphasis>CQ</emphasis> fields.</para>\r
487                 </simplesect>\r
488                 <simplesect xml:id="SIP_Renew_All">\r
489                         <title>65/66 Renew All</title>\r
490                         <para>Not yet supported.</para>\r
491                 </simplesect>\r
492                 <simplesect xml:id="SIP_Login">\r
493                         <title>93/94 Login</title>\r
494                         <para>Example:</para>\r
495                         <screen>9300CNsip_01|CObad_value|CPBR1|</screen>\r
496                         <screen>[Connection closed by foreign host.]</screen>\r
497                         <screen>...</screen>\r
498                         <screen>9300CNsip_01|COsip_01|CPBR1|</screen>\r
499                         <screen>941</screen>\r
500                         <para>941 means successful terminal login. 940 or getting dropped means failure.</para>\r
501                 </simplesect>\r
502                 <simplesect xml:id="SIP_Resend">\r
503                         <title>97/96 Resend</title>\r
504                 </simplesect>\r
505                 <simplesect xml:id="SIP_SC_ACS_Status">\r
506                         <title>99/98 SC and ACS Status</title>\r
507                         <screen>99&lt;status code&gt;&lt;max print width&gt;&lt;protocol version&gt;</screen>\r
508                         <para>All 3 fields are required:</para>\r
509                         <itemizedlist>\r
510                                         <listitem>status code - 1 character:</listitem>\r
511                                         <itemizedlist>\r
512                                                 <listitem>0: SC is OK</listitem>\r
513                                                 <listitem>SC is out of paper</listitem>\r
514                                                 <listitem>SC shutting down</listitem>           \r
515                                         </itemizedlist>\r
516                                         <listitem>max print width - 3 characters - the integer number of characters the client can print</listitem>\r
517                                         <listitem>protocol version - 4 characters - x.xx</listitem>\r
518                         </itemizedlist>\r
519                         <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
520                         <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
521                         <screen>location&gt;&lt;screen message&gt;&lt;print line&gt;</screen>\r
522                         <para>Example:</para>\r
523                         <screen>9910302.00</screen>\r
524                         <screen>98YYYYNN60000320100510    1717202.00AOCONS|BXYYYYYYYYYNYNNNYN|</screen>\r
525                         <para>The Supported Messages field <emphasis>(BX)</emphasis> appears only in <systemitem class="protocol">SIP2</systemitem>, and specifies whether 16 different \r
526                         <systemitem class="protocol">SIP</systemitem>  commands are supported by the ACS or not.</para>\r
527                 </simplesect>\r
528                 <simplesect xml:id="SIP_Fields">\r
529                         <title>Fields</title>\r
530                         <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
531                         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
532                         unnecessary, since you should know the exact position where that field begins already.</para>\r
533                 </simplesect>\r
534         </section>\r
535 </chapter>\r
536 \r