| 1 | #!/usr/bin/perl -T | ||
| 2 | |||
| 3 | package main; | ||
| 4 | |||
| 5 | use promessaging::MRS; | ||
| 6 | use Data::Dumper; | ||
| 7 | |||
| 8 | if ($#ARGV==-1||$#ARGV!=3||$#ARGV>3) | ||
| 9 | { | ||
| 10 | print "\n"; | ||
| 11 | print "Error, you didn't provide the correct number or order of parameters ... Execution aborted.\n\n"; | ||
| 12 | print "You have to provide the following 4 parameters in the order demonstrated below.\n\n"; | ||
| 13 | print "First, '-userid-' a valid account id, e.g. '12345'.\n"; | ||
| 14 | print "Secondly, '-passwd-' a valid password for the given account id, e.g. 'mysecretpasswd'.\n"; | ||
| 15 | print "Thirdly, '-profile-' a vaild profile number, e.g. '5'. Ask 'hotline\@end2endmobile.com' for your appropriate profile.\n"; | ||
| 16 | print "Fourthly, '-msisdn-' a valid MSISDN in international format, e.g. '+441719876543'.\n\n"; | ||
| 17 | } | ||
| 18 | else { | ||
| 19 | |||
| 20 | if (!($mrs_object = promessaging::MRS->new())) { | ||
| 21 | print "Can't create MRS object.\n"; | ||
| 22 | exit; | ||
| 23 | } | ||
| 24 | |||
| 25 | |||
| 26 | |||
| 27 | # NB: MSISDNResolve() parameter info below | ||
| 28 | |||
| 29 | # -userid- = a valid account id, e.g. '12345' | ||
| 30 | # -passwd- = a valid password for the given account, e.g. 'mysecretpasswd' | ||
| 31 | # 0 = a valid profile integer value (range from 0 to 7 - ask the hotline for your corresponding profile), e.g. '6' | ||
| 32 | # -msisdn- = a valid MSISDN in international format, e.g. '+491710123456' | ||
| 33 | |||
| 34 | |||
| 35 | #my $result = $mrs_object->MSISDNResolve("-userid-", "-passwd-", 0, "-msisdn-"); | ||
| 36 | |||
| 37 | |||
| 38 | my $result = $mrs_object->MSISDNResolve($ARGV[0],$ARGV[1],$ARGV[2],$ARGV[3]); | ||
| 39 | |||
| 40 | |||
| 41 | if ($result < 0) { | ||
| 42 | print "error: " . $mrs_object->getError() . "\n"; | ||
| 43 | } else { | ||
| 44 | print Dumper($result) . "\n"; | ||
| 45 | } | ||
| 46 | |||
| 47 | exit 0; | ||
| 48 | |||
| 49 | } |