Lines 4-19
Link Here
|
4 |
# A Class for handing SIP messages |
4 |
# A Class for handing SIP messages |
5 |
# |
5 |
# |
6 |
|
6 |
|
7 |
package Sip::MsgType; |
7 |
package C4::SIP::Sip::MsgType; |
8 |
|
8 |
|
9 |
use strict; |
9 |
use strict; |
10 |
use warnings; |
10 |
use warnings; |
11 |
use Exporter; |
11 |
use Exporter; |
12 |
use Sys::Syslog qw(syslog); |
12 |
use Sys::Syslog qw(syslog); |
13 |
|
13 |
|
14 |
use Sip qw(:all); |
14 |
use C4::SIP::Sip qw(:all); |
15 |
use Sip::Constants qw(:all); |
15 |
use C4::SIP::Sip::Constants qw(:all); |
16 |
use Sip::Checksum qw(verify_cksum); |
16 |
use C4::SIP::Sip::Checksum qw(verify_cksum); |
17 |
|
17 |
|
18 |
use Data::Dumper; |
18 |
use Data::Dumper; |
19 |
use CGI qw ( -utf8 ); |
19 |
use CGI qw ( -utf8 ); |
Lines 26-32
use vars qw(@ISA $VERSION @EXPORT_OK);
Link Here
|
26 |
BEGIN { |
26 |
BEGIN { |
27 |
$VERSION = 3.07.00.049; |
27 |
$VERSION = 3.07.00.049; |
28 |
@ISA = qw(Exporter); |
28 |
@ISA = qw(Exporter); |
29 |
@EXPORT_OK = qw(handle); |
29 |
@EXPORT_OK = qw(handle login_core); |
30 |
} |
30 |
} |
31 |
|
31 |
|
32 |
# Predeclare handler subroutines |
32 |
# Predeclare handler subroutines |
Lines 373-379
sub handle {
Link Here
|
373 |
if ($msg eq REQUEST_ACS_RESEND_CKSUM) { |
373 |
if ($msg eq REQUEST_ACS_RESEND_CKSUM) { |
374 |
# Special case |
374 |
# Special case |
375 |
$error_detection = 1; |
375 |
$error_detection = 1; |
376 |
$self = new Sip::MsgType ((REQUEST_ACS_RESEND), 0); |
376 |
$self = C4::SIP::Sip::MsgType->new((REQUEST_ACS_RESEND), 0); |
377 |
} elsif((length($msg) > 11) && (substr($msg, -9, 2) eq "AY")) { |
377 |
} elsif((length($msg) > 11) && (substr($msg, -9, 2) eq "AY")) { |
378 |
$error_detection = 1; |
378 |
$error_detection = 1; |
379 |
|
379 |
|
Lines 386-392
sub handle {
Link Here
|
386 |
} else { |
386 |
} else { |
387 |
# Save the sequence number, then strip off the |
387 |
# Save the sequence number, then strip off the |
388 |
# error detection data to process the message |
388 |
# error detection data to process the message |
389 |
$self = new Sip::MsgType (substr($msg, 0, -9), substr($msg, -7, 1)); |
389 |
$self = C4::SIP::Sip::MsgType->new(substr($msg, 0, -9), substr($msg, -7, 1)); |
390 |
} |
390 |
} |
391 |
} elsif ($error_detection) { |
391 |
} elsif ($error_detection) { |
392 |
# We received a non-ED message when ED is supposed to be active. |
392 |
# We received a non-ED message when ED is supposed to be active. |
Lines 394-402
sub handle {
Link Here
|
394 |
syslog("LOG_WARNING", |
394 |
syslog("LOG_WARNING", |
395 |
"Received message without error detection: '%s'", $msg); |
395 |
"Received message without error detection: '%s'", $msg); |
396 |
$error_detection = 0; |
396 |
$error_detection = 0; |
397 |
$self = new Sip::MsgType ($msg, 0); |
397 |
$self = C4::SIP::Sip::MsgType->new($msg, 0); |
398 |
} else { |
398 |
} else { |
399 |
$self = new Sip::MsgType ($msg, 0); |
399 |
$self = C4::SIP::Sip::MsgType->new($msg, 0); |
400 |
} |
400 |
} |
401 |
|
401 |
|
402 |
if ((substr($msg, 0, 2) ne REQUEST_ACS_RESEND) && |
402 |
if ((substr($msg, 0, 2) ne REQUEST_ACS_RESEND) && |
Lines 438-444
sub build_patron_status {
Link Here
|
438 |
|
438 |
|
439 |
if ($patron) { |
439 |
if ($patron) { |
440 |
$resp .= patron_status_string($patron); |
440 |
$resp .= patron_status_string($patron); |
441 |
$resp .= $lang . Sip::timestamp(); |
441 |
$resp .= $lang . timestamp(); |
442 |
$resp .= add_field(FID_PERSONAL_NAME, $patron->name); |
442 |
$resp .= add_field(FID_PERSONAL_NAME, $patron->name); |
443 |
|
443 |
|
444 |
# while the patron ID we got from the SC is valid, let's |
444 |
# while the patron ID we got from the SC is valid, let's |
Lines 460-466
sub build_patron_status {
Link Here
|
460 |
} else { |
460 |
} else { |
461 |
# Invalid patron id. Report that the user has no privs., |
461 |
# Invalid patron id. Report that the user has no privs., |
462 |
# no personal name, and is invalid (if we're using 2.00) |
462 |
# no personal name, and is invalid (if we're using 2.00) |
463 |
$resp .= 'YYYY' . (' ' x 10) . $lang . Sip::timestamp(); |
463 |
$resp .= 'YYYY' . (' ' x 10) . $lang . timestamp(); |
464 |
$resp .= add_field(FID_PERSONAL_NAME, ''); |
464 |
$resp .= add_field(FID_PERSONAL_NAME, ''); |
465 |
|
465 |
|
466 |
# the patron ID is invalid, but it's a required field, so |
466 |
# the patron ID is invalid, but it's a required field, so |
Lines 543-549
sub handle_checkout {
Link Here
|
543 |
} |
543 |
} |
544 |
# We never return the obsolete 'U' value for 'desensitize' |
544 |
# We never return the obsolete 'U' value for 'desensitize' |
545 |
$resp .= sipbool($status->desensitize); |
545 |
$resp .= sipbool($status->desensitize); |
546 |
$resp .= Sip::timestamp; |
546 |
$resp .= timestamp; |
547 |
|
547 |
|
548 |
# Now for the variable fields |
548 |
# Now for the variable fields |
549 |
$resp .= add_field(FID_INST_ID, $inst); |
549 |
$resp .= add_field(FID_INST_ID, $inst); |
Lines 551-557
sub handle_checkout {
Link Here
|
551 |
$resp .= add_field(FID_ITEM_ID, $item_id); |
551 |
$resp .= add_field(FID_ITEM_ID, $item_id); |
552 |
$resp .= add_field(FID_TITLE_ID, $item->title_id); |
552 |
$resp .= add_field(FID_TITLE_ID, $item->title_id); |
553 |
if ($item->due_date) { |
553 |
if ($item->due_date) { |
554 |
$resp .= add_field(FID_DUE_DATE, Sip::timestamp($item->due_date)); |
554 |
$resp .= add_field(FID_DUE_DATE, timestamp($item->due_date)); |
555 |
} else { |
555 |
} else { |
556 |
$resp .= add_field(FID_DUE_DATE, q{}); |
556 |
$resp .= add_field(FID_DUE_DATE, q{}); |
557 |
} |
557 |
} |
Lines 581-587
sub handle_checkout {
Link Here
|
581 |
# Checkout failed |
581 |
# Checkout failed |
582 |
# Checkout Response: not ok, no renewal, don't know mag. media, |
582 |
# Checkout Response: not ok, no renewal, don't know mag. media, |
583 |
# no desensitize |
583 |
# no desensitize |
584 |
$resp = sprintf("120NUN%s", Sip::timestamp); |
584 |
$resp = sprintf("120NUN%s", timestamp); |
585 |
$resp .= add_field(FID_INST_ID, $inst); |
585 |
$resp .= add_field(FID_INST_ID, $inst); |
586 |
$resp .= add_field(FID_PATRON_ID, $patron_id); |
586 |
$resp .= add_field(FID_PATRON_ID, $patron_id); |
587 |
$resp .= add_field(FID_ITEM_ID, $item_id); |
587 |
$resp .= add_field(FID_ITEM_ID, $item_id); |
Lines 663-669
sub handle_checkin {
Link Here
|
663 |
} |
663 |
} |
664 |
} |
664 |
} |
665 |
$resp .= $status->alert ? 'Y' : 'N'; |
665 |
$resp .= $status->alert ? 'Y' : 'N'; |
666 |
$resp .= Sip::timestamp; |
666 |
$resp .= timestamp; |
667 |
$resp .= add_field(FID_INST_ID, $inst_id); |
667 |
$resp .= add_field(FID_INST_ID, $inst_id); |
668 |
$resp .= add_field(FID_ITEM_ID, $item_id); |
668 |
$resp .= add_field(FID_ITEM_ID, $item_id); |
669 |
|
669 |
|
Lines 832-837
sub login_core {
Link Here
|
832 |
# |
832 |
# |
833 |
my $module = $server->{config}->{institutions}->{$inst}->{implementation}; |
833 |
my $module = $server->{config}->{institutions}->{$inst}->{implementation}; |
834 |
syslog("LOG_DEBUG", 'login_core: ' . Dumper($module)); |
834 |
syslog("LOG_DEBUG", 'login_core: ' . Dumper($module)); |
|
|
835 |
# Suspect this is always ILS but so we dont break any eccentic install (for now) |
836 |
if ($module eq 'ILS') { |
837 |
$module = 'C4::SIP::ILS'; |
838 |
} |
835 |
$module->use; |
839 |
$module->use; |
836 |
if ($@) { |
840 |
if ($@) { |
837 |
syslog("LOG_ERR", "%s: Loading ILS implementation '%s' for institution '%s' failed", |
841 |
syslog("LOG_ERR", "%s: Loading ILS implementation '%s' for institution '%s' failed", |
Lines 938-944
sub handle_patron_info {
Link Here
|
938 |
if ($patron) { |
942 |
if ($patron) { |
939 |
$resp .= patron_status_string($patron); |
943 |
$resp .= patron_status_string($patron); |
940 |
$resp .= (defined($lang) and length($lang) ==3) ? $lang : $patron->language; |
944 |
$resp .= (defined($lang) and length($lang) ==3) ? $lang : $patron->language; |
941 |
$resp .= Sip::timestamp(); |
945 |
$resp .= timestamp(); |
942 |
|
946 |
|
943 |
$resp .= add_count('patron_info/hold_items', |
947 |
$resp .= add_count('patron_info/hold_items', |
944 |
scalar @{$patron->hold_items}); |
948 |
scalar @{$patron->hold_items}); |
Lines 1006-1012
sub handle_patron_info {
Link Here
|
1006 |
# Invalid patron ID: |
1010 |
# Invalid patron ID: |
1007 |
# no privileges, no items associated, |
1011 |
# no privileges, no items associated, |
1008 |
# no personal name, and is invalid (if we're using 2.00) |
1012 |
# no personal name, and is invalid (if we're using 2.00) |
1009 |
$resp .= 'YYYY' . (' ' x 10) . $lang . Sip::timestamp(); |
1013 |
$resp .= 'YYYY' . (' ' x 10) . $lang . timestamp(); |
1010 |
$resp .= '0000' x 6; |
1014 |
$resp .= '0000' x 6; |
1011 |
|
1015 |
|
1012 |
$resp .= add_field(FID_INST_ID, ($ils->institution_id || 'SIP2')); |
1016 |
$resp .= add_field(FID_INST_ID, ($ils->institution_id || 'SIP2')); |
Lines 1038-1044
sub handle_end_patron_session {
Link Here
|
1038 |
($status, $screen_msg, $print_line) = $ils->end_patron_session($fields->{(FID_PATRON_ID)}); |
1042 |
($status, $screen_msg, $print_line) = $ils->end_patron_session($fields->{(FID_PATRON_ID)}); |
1039 |
|
1043 |
|
1040 |
$resp .= $status ? 'Y' : 'N'; |
1044 |
$resp .= $status ? 'Y' : 'N'; |
1041 |
$resp .= Sip::timestamp(); |
1045 |
$resp .= timestamp(); |
1042 |
|
1046 |
|
1043 |
$resp .= add_field(FID_INST_ID, $server->{ils}->institution); |
1047 |
$resp .= add_field(FID_INST_ID, $server->{ils}->institution); |
1044 |
$resp .= add_field(FID_PATRON_ID, $fields->{(FID_PATRON_ID)}); |
1048 |
$resp .= add_field(FID_PATRON_ID, $fields->{(FID_PATRON_ID)}); |
Lines 1073-1079
sub handle_fee_paid {
Link Here
|
1073 |
$status = $ils->pay_fee($patron_id, $patron_pwd, $fee_amt, $fee_type, |
1077 |
$status = $ils->pay_fee($patron_id, $patron_pwd, $fee_amt, $fee_type, |
1074 |
$pay_type, $fee_id, $trans_id, $currency); |
1078 |
$pay_type, $fee_id, $trans_id, $currency); |
1075 |
|
1079 |
|
1076 |
$resp .= ($status->ok ? 'Y' : 'N') . Sip::timestamp; |
1080 |
$resp .= ($status->ok ? 'Y' : 'N') . timestamp; |
1077 |
$resp .= add_field(FID_INST_ID, $inst_id); |
1081 |
$resp .= add_field(FID_INST_ID, $inst_id); |
1078 |
$resp .= add_field(FID_PATRON_ID, $patron_id); |
1082 |
$resp .= add_field(FID_PATRON_ID, $patron_id); |
1079 |
$resp .= maybe_add(FID_TRANSACTION_ID, $status->transaction_id); |
1083 |
$resp .= maybe_add(FID_TRANSACTION_ID, $status->transaction_id); |
Lines 1104-1110
sub handle_item_information {
Link Here
|
1104 |
# Invalid Item ID |
1108 |
# Invalid Item ID |
1105 |
# "Other" circ stat, "Other" security marker, "Unknown" fee type |
1109 |
# "Other" circ stat, "Other" security marker, "Unknown" fee type |
1106 |
$resp .= "010101"; |
1110 |
$resp .= "010101"; |
1107 |
$resp .= Sip::timestamp; |
1111 |
$resp .= timestamp; |
1108 |
# Just echo back the invalid item id |
1112 |
# Just echo back the invalid item id |
1109 |
$resp .= add_field(FID_ITEM_ID, $fields->{(FID_ITEM_ID)}); |
1113 |
$resp .= add_field(FID_ITEM_ID, $fields->{(FID_ITEM_ID)}); |
1110 |
# title id is required, but we don't have one |
1114 |
# title id is required, but we don't have one |
Lines 1114-1120
sub handle_item_information {
Link Here
|
1114 |
$resp .= $item->sip_circulation_status; |
1118 |
$resp .= $item->sip_circulation_status; |
1115 |
$resp .= $item->sip_security_marker; |
1119 |
$resp .= $item->sip_security_marker; |
1116 |
$resp .= $item->sip_fee_type; |
1120 |
$resp .= $item->sip_fee_type; |
1117 |
$resp .= Sip::timestamp; |
1121 |
$resp .= timestamp; |
1118 |
|
1122 |
|
1119 |
$resp .= add_field(FID_ITEM_ID, $item->id); |
1123 |
$resp .= add_field(FID_ITEM_ID, $item->id); |
1120 |
$resp .= add_field(FID_TITLE_ID, $item->title_id); |
1124 |
$resp .= add_field(FID_TITLE_ID, $item->title_id); |
Lines 1134-1146
sub handle_item_information {
Link Here
|
1134 |
$resp .= add_field(FID_HOLD_QUEUE_LEN, $i); |
1138 |
$resp .= add_field(FID_HOLD_QUEUE_LEN, $i); |
1135 |
} |
1139 |
} |
1136 |
if ($item->due_date) { |
1140 |
if ($item->due_date) { |
1137 |
$resp .= add_field(FID_DUE_DATE, Sip::timestamp($item->due_date)); |
1141 |
$resp .= add_field(FID_DUE_DATE, timestamp($item->due_date)); |
1138 |
} |
1142 |
} |
1139 |
if (($i = $item->recall_date) != 0) { |
1143 |
if (($i = $item->recall_date) != 0) { |
1140 |
$resp .= add_field(FID_RECALL_DATE, Sip::timestamp($i)); |
1144 |
$resp .= add_field(FID_RECALL_DATE, timestamp($i)); |
1141 |
} |
1145 |
} |
1142 |
if (($i = $item->hold_pickup_date) != 0) { |
1146 |
if (($i = $item->hold_pickup_date) != 0) { |
1143 |
$resp .= add_field(FID_HOLD_PICKUP_DATE, Sip::timestamp($i)); |
1147 |
$resp .= add_field(FID_HOLD_PICKUP_DATE, timestamp($i)); |
1144 |
} |
1148 |
} |
1145 |
|
1149 |
|
1146 |
$resp .= maybe_add(FID_SCREEN_MSG, $item->screen_msg, $server); |
1150 |
$resp .= maybe_add(FID_SCREEN_MSG, $item->screen_msg, $server); |
Lines 1178-1184
sub handle_item_status_update {
Link Here
|
1178 |
if (!$item) { |
1182 |
if (!$item) { |
1179 |
# Invalid Item ID |
1183 |
# Invalid Item ID |
1180 |
$resp .= '0'; |
1184 |
$resp .= '0'; |
1181 |
$resp .= Sip::timestamp; |
1185 |
$resp .= timestamp; |
1182 |
$resp .= add_field(FID_ITEM_ID, $item_id); |
1186 |
$resp .= add_field(FID_ITEM_ID, $item_id); |
1183 |
} else { |
1187 |
} else { |
1184 |
# Valid Item ID |
1188 |
# Valid Item ID |
Lines 1186-1192
sub handle_item_status_update {
Link Here
|
1186 |
$status = $item->status_update($item_props); |
1190 |
$status = $item->status_update($item_props); |
1187 |
|
1191 |
|
1188 |
$resp .= $status->ok ? '1' : '0'; |
1192 |
$resp .= $status->ok ? '1' : '0'; |
1189 |
$resp .= Sip::timestamp; |
1193 |
$resp .= timestamp; |
1190 |
|
1194 |
|
1191 |
$resp .= add_field(FID_ITEM_ID, $item->id); |
1195 |
$resp .= add_field(FID_ITEM_ID, $item->id); |
1192 |
$resp .= add_field(FID_TITLE_ID, $item->title_id); |
1196 |
$resp .= add_field(FID_TITLE_ID, $item->title_id); |
Lines 1220-1226
sub handle_patron_enable {
Link Here
|
1220 |
|
1224 |
|
1221 |
if (!defined($patron)) { |
1225 |
if (!defined($patron)) { |
1222 |
# Invalid patron ID |
1226 |
# Invalid patron ID |
1223 |
$resp .= 'YYYY' . (' ' x 10) . '000' . Sip::timestamp(); |
1227 |
$resp .= 'YYYY' . (' ' x 10) . '000' . timestamp(); |
1224 |
$resp .= add_field(FID_PATRON_ID, $patron_id); |
1228 |
$resp .= add_field(FID_PATRON_ID, $patron_id); |
1225 |
$resp .= add_field(FID_PERSONAL_NAME, ''); |
1229 |
$resp .= add_field(FID_PERSONAL_NAME, ''); |
1226 |
$resp .= add_field(FID_VALID_PATRON, 'N'); |
1230 |
$resp .= add_field(FID_VALID_PATRON, 'N'); |
Lines 1232-1238
sub handle_patron_enable {
Link Here
|
1232 |
$status = $patron->enable; |
1236 |
$status = $patron->enable; |
1233 |
} |
1237 |
} |
1234 |
$resp .= patron_status_string($patron); |
1238 |
$resp .= patron_status_string($patron); |
1235 |
$resp .= $patron->language . Sip::timestamp(); |
1239 |
$resp .= $patron->language . timestamp(); |
1236 |
|
1240 |
|
1237 |
$resp .= add_field(FID_PATRON_ID, $patron->id); |
1241 |
$resp .= add_field(FID_PATRON_ID, $patron->id); |
1238 |
$resp .= add_field(FID_PERSONAL_NAME, $patron->name); |
1242 |
$resp .= add_field(FID_PERSONAL_NAME, $patron->name); |
Lines 1292-1305
sub handle_hold {
Link Here
|
1292 |
|
1296 |
|
1293 |
$resp .= $status->ok; |
1297 |
$resp .= $status->ok; |
1294 |
$resp .= sipbool($status->item && $status->item->available($patron_id)); |
1298 |
$resp .= sipbool($status->item && $status->item->available($patron_id)); |
1295 |
$resp .= Sip::timestamp; |
1299 |
$resp .= timestamp; |
1296 |
|
1300 |
|
1297 |
if ($status->ok) { |
1301 |
if ($status->ok) { |
1298 |
$resp .= add_field(FID_PATRON_ID, $status->patron->id); |
1302 |
$resp .= add_field(FID_PATRON_ID, $status->patron->id); |
1299 |
|
1303 |
|
1300 |
($status->expiration_date) and |
1304 |
($status->expiration_date) and |
1301 |
$resp .= maybe_add(FID_EXPIRATION, |
1305 |
$resp .= maybe_add(FID_EXPIRATION, |
1302 |
Sip::timestamp($status->expiration_date)); |
1306 |
timestamp($status->expiration_date)); |
1303 |
$resp .= maybe_add(FID_QUEUE_POS, $status->queue_position); |
1307 |
$resp .= maybe_add(FID_QUEUE_POS, $status->queue_position); |
1304 |
$resp .= maybe_add(FID_PICKUP_LOCN, $status->pickup_location); |
1308 |
$resp .= maybe_add(FID_PICKUP_LOCN, $status->pickup_location); |
1305 |
$resp .= maybe_add(FID_ITEM_ID, $status->item->id); |
1309 |
$resp .= maybe_add(FID_ITEM_ID, $status->item->id); |
Lines 1362-1373
sub handle_renew {
Link Here
|
1362 |
$resp .= 'U'; |
1366 |
$resp .= 'U'; |
1363 |
} |
1367 |
} |
1364 |
$resp .= sipbool($status->desensitize); |
1368 |
$resp .= sipbool($status->desensitize); |
1365 |
$resp .= Sip::timestamp; |
1369 |
$resp .= timestamp; |
1366 |
$resp .= add_field(FID_PATRON_ID, $patron->id); |
1370 |
$resp .= add_field(FID_PATRON_ID, $patron->id); |
1367 |
$resp .= add_field(FID_ITEM_ID, $item->id); |
1371 |
$resp .= add_field(FID_ITEM_ID, $item->id); |
1368 |
$resp .= add_field(FID_TITLE_ID, $item->title_id); |
1372 |
$resp .= add_field(FID_TITLE_ID, $item->title_id); |
1369 |
if ($item->due_date) { |
1373 |
if ($item->due_date) { |
1370 |
$resp .= add_field(FID_DUE_DATE, Sip::timestamp($item->due_date)); |
1374 |
$resp .= add_field(FID_DUE_DATE, timestamp($item->due_date)); |
1371 |
} else { |
1375 |
} else { |
1372 |
$resp .= add_field(FID_DUE_DATE, q{}); |
1376 |
$resp .= add_field(FID_DUE_DATE, q{}); |
1373 |
} |
1377 |
} |
Lines 1381-1387
sub handle_renew {
Link Here
|
1381 |
# renew failed for some reason |
1385 |
# renew failed for some reason |
1382 |
# not OK, renewal not OK, Unknown media type (why bother checking?) |
1386 |
# not OK, renewal not OK, Unknown media type (why bother checking?) |
1383 |
$resp .= '0NUN'; |
1387 |
$resp .= '0NUN'; |
1384 |
$resp .= Sip::timestamp; |
1388 |
$resp .= timestamp; |
1385 |
# If we found the patron or the item, the return the ILS |
1389 |
# If we found the patron or the item, the return the ILS |
1386 |
# information, otherwise echo back the infomation we received |
1390 |
# information, otherwise echo back the infomation we received |
1387 |
# from the terminal |
1391 |
# from the terminal |
Lines 1443-1449
sub handle_renew_all {
Link Here
|
1443 |
$resp .= add_count("renew_all/unrenewed_count", scalar @unrenewed); |
1447 |
$resp .= add_count("renew_all/unrenewed_count", scalar @unrenewed); |
1444 |
} |
1448 |
} |
1445 |
|
1449 |
|
1446 |
$resp .= Sip::timestamp; |
1450 |
$resp .= timestamp; |
1447 |
$resp .= add_field(FID_INST_ID, $ils->institution); |
1451 |
$resp .= add_field(FID_INST_ID, $ils->institution); |
1448 |
|
1452 |
|
1449 |
$resp .= join('', map(add_field(FID_RENEWED_ITEMS , $_), @renewed )); |
1453 |
$resp .= join('', map(add_field(FID_RENEWED_ITEMS , $_), @renewed )); |
Lines 1516-1522
sub send_acs_status {
Link Here
|
1516 |
|
1520 |
|
1517 |
$msg .= "$online_status$checkin_ok$checkout_ok$ACS_renewal_policy"; |
1521 |
$msg .= "$online_status$checkin_ok$checkout_ok$ACS_renewal_policy"; |
1518 |
$msg .= "$status_update_ok$offline_ok$timeout$retries"; |
1522 |
$msg .= "$status_update_ok$offline_ok$timeout$retries"; |
1519 |
$msg .= Sip::timestamp(); |
1523 |
$msg .= timestamp(); |
1520 |
|
1524 |
|
1521 |
if ($protocol_version == 1) { |
1525 |
if ($protocol_version == 1) { |
1522 |
$msg .= '1.00'; |
1526 |
$msg .= '1.00'; |
Lines 1538-1546
sub send_acs_status {
Link Here
|
1538 |
|
1542 |
|
1539 |
foreach my $msg_name (@message_type_names) { |
1543 |
foreach my $msg_name (@message_type_names) { |
1540 |
if ($msg_name eq 'request sc/acs resend') { |
1544 |
if ($msg_name eq 'request sc/acs resend') { |
1541 |
$supported_msgs .= Sip::sipbool(1); |
1545 |
$supported_msgs .= sipbool(1); |
1542 |
} else { |
1546 |
} else { |
1543 |
$supported_msgs .= Sip::sipbool($ils->supports($msg_name)); |
1547 |
$supported_msgs .= sipbool($ils->supports($msg_name)); |
1544 |
} |
1548 |
} |
1545 |
} |
1549 |
} |
1546 |
if (length($supported_msgs) < 16) { |
1550 |
if (length($supported_msgs) < 16) { |