Bugzilla – Attachment 14640 Details for
Bug 9288
Add a script to test SIP from the command line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9288 - Add a script to test SIP from the command line
Bug-9288---Add-a-script-to-test-SIP-from-the-comma.patch (text/plain), 3.02 KB, created by
Kyle M Hall (khall)
on 2013-01-16 20:53:06 UTC
(
hide
)
Description:
Bug 9288 - Add a script to test SIP from the command line
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-01-16 20:53:06 UTC
Size:
3.02 KB
patch
obsolete
>From 0ace263d7e632b168a66ce5d84cc949a8314481a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 14 Dec 2012 11:56:36 -0500 >Subject: [PATCH] Bug 9288 - Add a script to test SIP from the command line > >This is a very basic start to a sip server testing script. >I imagine we will want to make it interactive in end, >essentially replicating what a SIP based self-checkout machine does. >--- > misc/sip_test.pl | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 85 insertions(+), 0 deletions(-) > create mode 100644 misc/sip_test.pl > >diff --git a/misc/sip_test.pl b/misc/sip_test.pl >new file mode 100644 >index 0000000..a68b563 >--- /dev/null >+++ b/misc/sip_test.pl >@@ -0,0 +1,85 @@ >+#!/usr/bin/perl >+ >+use IO::Socket::INET; >+use Getopt::Long; >+ >+my $host; >+my $port = '6001'; >+ >+my $login_user_id; >+my $login_password; >+my $location_code; >+ >+my $patron_identifier; >+my $patron_password; >+ >+GetOptions( >+ "h|host=s" => \$host, # sip server ip >+ "p|port=s" => \$port, # sip server port >+ "su|sip_user=s" => \$login_user_id, # sip user >+ "sp|sip_pass=s" => \$login_password, # sip password >+ "l|location|location_code=s" => \$location_code, # sip location code >+ >+ "patron=s" => \$patron_identifier, # patron cardnumber or login >+ "password=s" => \$patron_password, # patron's password >+); >+ >+my ( $sec, $min, $hour, $day, $month, $year ) = localtime(time); >+$year += 1900; >+my $transaction_date = "$year$month$day $hour$min$sec"; >+ >+my $institution_id = $location_code; >+my $terminal_password = $login_password; >+ >+$socket = IO::Socket::INET->new("$host:$port") >+ or die "ERROR in Socket Creation host=$host port=$port : $!\n"; >+ >+my $login_command = "9300CN$login_user_id|CO$login_password|CP$location_code|"; >+ >+print "\nOUTBOUND: $login_command\n"; >+print $socket $login_command . "\r"; >+ >+$data = <$socket>; >+ >+print "\nINBOUND: $data\n"; >+ >+if ( $data =~ '^941' ) { ## we are logged in >+ >+ ## Patron Status Request >+ print "\nTrying 'Patron Status Request'\n"; >+ my $patron_status_request = "23001" >+ . $transaction_date >+ . "AO" . $institution_id >+ . "|AA" . $patron_identifier >+ . "|AC" . $terminal_password >+ . "|AD" . $patron_password; >+ >+ print "\nOUTBOUND: $patron_status_request\n"; >+ print $socket $patron_status_request . "\r"; >+ >+ $data = <$socket>; >+ >+ print "\nINBOUND: $data\n"; >+ >+ ## Patron Information >+ print "\nTrying 'Patron Information'\n"; >+ my $summary = " "; >+ my $patron_status_request = "63001" >+ . $transaction_date >+ . $summary >+ . "AO" . $institution_id >+ . "|AA" . $patron_identifier >+ . "|AC" . $terminal_password >+ . "|AD" . $patron_password; >+ >+ print "\nOUTBOUND: $patron_status_request\n"; >+ print $socket $patron_status_request . "\r"; >+ >+ $data = <$socket>; >+ >+ print "\nINBOUND: $data\n"; >+ >+} >+else { >+ print "\nLogin Failed!\n"; >+} >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9288
:
14146
|
14147
|
14148
|
14149
|
14150
|
14635
|
14640
|
18203
|
18268
|
19106
|
19476
|
21278
|
22286
|
22443
|
22444
|
22445
|
22446
|
23873