Change-Id: I3e1f201f4ce8c47b8836c75e5cd018e45b93756echanges/75/26575/5
parent
c09f10d8a4
commit
2638f6e091
@ -0,0 +1,49 @@
|
||||
package NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::AdditionalDigitsDialed;
|
||||
use strict;
|
||||
|
||||
## no critic
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Field qw($TERMINATOR);
|
||||
|
||||
#use NGCP::BulkProcessor::Array qw(contains);
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter NGCP::BulkProcessor::Projects::Export::Ama::Format::Field);
|
||||
our @EXPORT_OK = qw(
|
||||
|
||||
);
|
||||
|
||||
my $field_name = "digits string";
|
||||
my $length = 16;
|
||||
my @param_names = qw/additional_digits_dialed/;
|
||||
|
||||
sub new {
|
||||
|
||||
my $class = shift;
|
||||
my $self = NGCP::BulkProcessor::Projects::Export::Ama::Format::Field->new(
|
||||
$class,
|
||||
name => $field_name,
|
||||
length => $length,
|
||||
@_);
|
||||
|
||||
return $self;
|
||||
|
||||
}
|
||||
|
||||
sub _get_param_names {
|
||||
|
||||
my $self = shift;
|
||||
return @param_names;
|
||||
|
||||
}
|
||||
|
||||
sub get_hex {
|
||||
|
||||
my $self = shift;
|
||||
my ($additional_digits_dialed) = $self->_get_params(@_);
|
||||
die("invalid additional digits dialed '$additional_digits_dialed'") if (length($additional_digits_dialed) < 1 or length($additional_digits_dialed) > 15);
|
||||
return sprintf('%015d',$additional_digits_dialed) . $TERMINATOR;
|
||||
|
||||
}
|
||||
|
||||
1;
|
@ -0,0 +1,50 @@
|
||||
package NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::DataDescriptor;
|
||||
use strict;
|
||||
|
||||
## no critic
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Field qw($TERMINATOR);
|
||||
|
||||
#use NGCP::BulkProcessor::Array qw(contains);
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter NGCP::BulkProcessor::Projects::Export::Ama::Format::Field);
|
||||
our @EXPORT_OK = qw(
|
||||
|
||||
);
|
||||
|
||||
my $field_name = "data descriptor";
|
||||
my $length = 4;
|
||||
my @param_names = qw/data_descriptor/;
|
||||
|
||||
sub new {
|
||||
|
||||
my $class = shift;
|
||||
my $self = NGCP::BulkProcessor::Projects::Export::Ama::Format::Field->new(
|
||||
$class,
|
||||
name => $field_name,
|
||||
length => $length,
|
||||
@_);
|
||||
$self->{data_descriptor} //= 0;
|
||||
|
||||
return $self;
|
||||
|
||||
}
|
||||
|
||||
sub _get_param_names {
|
||||
|
||||
my $self = shift;
|
||||
return @param_names;
|
||||
|
||||
}
|
||||
|
||||
sub get_hex {
|
||||
|
||||
my $self = shift;
|
||||
my ($data_descriptor) = $self->_get_params(@_);
|
||||
die("invalid data descriptor '$data_descriptor'") if (length($data_descriptor) < 1 or length($data_descriptor) > 3);
|
||||
return sprintf('%03d',$data_descriptor) . '1'; # . $TERMINATOR;
|
||||
|
||||
}
|
||||
|
||||
1;
|
@ -0,0 +1,91 @@
|
||||
package NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::GenericContextIdentifier;
|
||||
use strict;
|
||||
|
||||
## no critic
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Field qw($TERMINATOR);
|
||||
|
||||
use NGCP::BulkProcessor::Array qw(contains);
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter NGCP::BulkProcessor::Projects::Export::Ama::Format::Field);
|
||||
our @EXPORT_OK = qw(
|
||||
$ADDITIONAL_BILLING
|
||||
$ISUP_CARRIER
|
||||
$ADDITIONAL_PARTY_CATEGORY
|
||||
$IN_CORRELATION_ID
|
||||
$CHARGE_AREA
|
||||
$FORWARD_FACILITY_COUNT
|
||||
$BACKWARD_FACILITY_COUNT
|
||||
$FTUP_BACKWARD_CHARGE
|
||||
$CLI_SCREENING
|
||||
$ADDITIONAL_CALLING
|
||||
$NUMBER_PORTABILITY
|
||||
$NPI
|
||||
$CPS
|
||||
);
|
||||
|
||||
my $field_name = "generic context identifier";
|
||||
my $length = 8;
|
||||
my @param_names = qw/generic_context_identifier parsing_rules/;
|
||||
|
||||
my @generic_context_ids = ();
|
||||
our $ADDITIONAL_BILLING = '80005';
|
||||
push(@generic_context_ids,$ADDITIONAL_BILLING);
|
||||
our $ISUP_CARRIER = '80006';
|
||||
push(@generic_context_ids,$ISUP_CARRIER);
|
||||
our $ADDITIONAL_PARTY_CATEGORY = '80008';
|
||||
push(@generic_context_ids,$ADDITIONAL_PARTY_CATEGORY);
|
||||
our $IN_CORRELATION_ID = '80014';
|
||||
push(@generic_context_ids,$IN_CORRELATION_ID);
|
||||
our $CHARGE_AREA = '80016';
|
||||
push(@generic_context_ids,$CHARGE_AREA);
|
||||
our $FORWARD_FACILITY_COUNT = '80021';
|
||||
push(@generic_context_ids,$FORWARD_FACILITY_COUNT);
|
||||
our $BACKWARD_FACILITY_COUNT = '80022';
|
||||
push(@generic_context_ids,$BACKWARD_FACILITY_COUNT);
|
||||
our $FTUP_BACKWARD_CHARGE = '80025';
|
||||
push(@generic_context_ids,$FTUP_BACKWARD_CHARGE);
|
||||
our $CLI_SCREENING = '80026';
|
||||
push(@generic_context_ids,$CLI_SCREENING);
|
||||
our $ADDITIONAL_CALLING = '80027';
|
||||
push(@generic_context_ids,$ADDITIONAL_CALLING);
|
||||
our $NUMBER_PORTABILITY = '80030';
|
||||
push(@generic_context_ids,$NUMBER_PORTABILITY);
|
||||
our $NPI = '80050';
|
||||
push(@generic_context_ids,$NPI);
|
||||
our $CPS = '80080';
|
||||
push(@generic_context_ids,$CPS);
|
||||
|
||||
sub new {
|
||||
|
||||
my $class = shift;
|
||||
my $self = NGCP::BulkProcessor::Projects::Export::Ama::Format::Field->new(
|
||||
$class,
|
||||
name => $field_name,
|
||||
length => $length,
|
||||
@_);
|
||||
$self->{parsing_rules} //= 0;
|
||||
|
||||
return $self;
|
||||
|
||||
}
|
||||
|
||||
sub _get_param_names {
|
||||
|
||||
my $self = shift;
|
||||
return @param_names;
|
||||
|
||||
}
|
||||
|
||||
sub get_hex {
|
||||
|
||||
my $self = shift;
|
||||
my ($generic_context_identifier,$parsing_rules) = $self->_get_params(@_);
|
||||
die("invalid generic context identifier '$generic_context_identifier'") unless contains($generic_context_identifier,\@generic_context_ids);
|
||||
die("invalid parsing rules '$parsing_rules'") if (length($parsing_rules) < 1 or length($parsing_rules) > 2);
|
||||
return $generic_context_identifier . sprintf('%02d',$parsing_rules) . $TERMINATOR;
|
||||
|
||||
}
|
||||
|
||||
1;
|
@ -0,0 +1,69 @@
|
||||
package NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::ModuleCode;
|
||||
use strict;
|
||||
|
||||
## no critic
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Field qw($TERMINATOR);
|
||||
|
||||
use NGCP::BulkProcessor::Array qw(contains);
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter NGCP::BulkProcessor::Projects::Export::Ama::Format::Field);
|
||||
our @EXPORT_OK = qw(
|
||||
$MODULE_CODE_611
|
||||
$MODULE_CODE_199
|
||||
$MODULE_CODE_104
|
||||
$MODULE_CODE_000
|
||||
);
|
||||
|
||||
my $field_name = "module code";
|
||||
my $length = 4;
|
||||
my @param_names = qw/module_code/;
|
||||
|
||||
my @module_codes = ();
|
||||
our $MODULE_CODE_611 = '611';
|
||||
push(@module_codes,$MODULE_CODE_611);
|
||||
our $MODULE_CODE_199 = '199';
|
||||
push(@module_codes,$MODULE_CODE_199);
|
||||
our $MODULE_CODE_104 = '104';
|
||||
push(@module_codes,$MODULE_CODE_104);
|
||||
our $MODULE_CODE_000 = '000';
|
||||
push(@module_codes,$MODULE_CODE_000);
|
||||
|
||||
sub new {
|
||||
|
||||
my $class = shift;
|
||||
my $self = NGCP::BulkProcessor::Projects::Export::Ama::Format::Field->new(
|
||||
$class,
|
||||
name => $field_name,
|
||||
length => $length,
|
||||
@_);
|
||||
|
||||
return $self;
|
||||
|
||||
}
|
||||
|
||||
sub _get_param_names {
|
||||
|
||||
my $self = shift;
|
||||
return @param_names;
|
||||
|
||||
}
|
||||
|
||||
sub get_module_code {
|
||||
|
||||
my $self = shift;
|
||||
return $self->{module_code};
|
||||
|
||||
}
|
||||
|
||||
sub get_hex {
|
||||
|
||||
my $self = shift;
|
||||
my ($module_code) = $self->_get_params(@_);
|
||||
die("invalid module code '$module_code'") unless contains($module_code,\@module_codes);
|
||||
return $module_code . $TERMINATOR;
|
||||
|
||||
}
|
||||
|
||||
1;
|
@ -0,0 +1,61 @@
|
||||
package NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::NetworkOperatorData;
|
||||
use strict;
|
||||
|
||||
## no critic
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Field qw($TERMINATOR);
|
||||
|
||||
#use NGCP::BulkProcessor::Array qw(contains);
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter NGCP::BulkProcessor::Projects::Export::Ama::Format::Field);
|
||||
our @EXPORT_OK = qw(
|
||||
get_network_operator_data
|
||||
);
|
||||
|
||||
my $field_name = "network operator data";
|
||||
my $length = 49;
|
||||
my @param_names = qw/network_operator_data/;
|
||||
|
||||
sub new {
|
||||
|
||||
my $class = shift;
|
||||
my $self = NGCP::BulkProcessor::Projects::Export::Ama::Format::Field->new(
|
||||
$class,
|
||||
name => $field_name,
|
||||
length => $length,
|
||||
@_);
|
||||
|
||||
return $self;
|
||||
|
||||
}
|
||||
|
||||
sub _get_param_names {
|
||||
|
||||
my $self = shift;
|
||||
return @param_names;
|
||||
|
||||
}
|
||||
|
||||
sub get_hex {
|
||||
|
||||
my $self = shift;
|
||||
my ($network_operator_data) = $self->_get_params(@_);
|
||||
die("invalid network operator data '$network_operator_data'") if length($network_operator_data) != 39;
|
||||
return $network_operator_data . '1'; #$TERMINATOR;
|
||||
|
||||
}
|
||||
|
||||
sub get_network_operator_data {
|
||||
my ($originating_digits,$switch_number_digits) = @_;
|
||||
my $result = $originating_digits;
|
||||
my $padlength = 16 - length($originating_digits);
|
||||
$result .= 'f' x $padlength;
|
||||
$result .= $switch_number_digits;
|
||||
$padlength = 20 - length($switch_number_digits);
|
||||
$result .= 'f' x $padlength;
|
||||
$result .= '800';
|
||||
return $result;
|
||||
}
|
||||
|
||||
1;
|
@ -0,0 +1,61 @@
|
||||
package NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::TrunkIdentification;
|
||||
use strict;
|
||||
|
||||
## no critic
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Field qw($TERMINATOR);
|
||||
|
||||
use NGCP::BulkProcessor::Array qw(contains);
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter NGCP::BulkProcessor::Projects::Export::Ama::Format::Field);
|
||||
our @EXPORT_OK = qw(
|
||||
$PADDING
|
||||
$INCOMING
|
||||
$OUTGOING
|
||||
);
|
||||
|
||||
my $field_name = "trunk identification number";
|
||||
my $length = 10;
|
||||
my @param_names = qw/direction trunk_group_number trunk_member_number/;
|
||||
|
||||
my @directions = ();
|
||||
our $PADDING = '0';
|
||||
push(@directions,$PADDING);
|
||||
our $INCOMING = '1';
|
||||
push(@directions,$INCOMING);
|
||||
our $OUTGOING = '2';
|
||||
push(@directions,$OUTGOING);
|
||||
|
||||
sub new {
|
||||
|
||||
my $class = shift;
|
||||
my $self = NGCP::BulkProcessor::Projects::Export::Ama::Format::Field->new(
|
||||
$class,
|
||||
name => $field_name,
|
||||
length => $length,
|
||||
@_);
|
||||
|
||||
return $self;
|
||||
|
||||
}
|
||||
|
||||
sub _get_param_names {
|
||||
|
||||
my $self = shift;
|
||||
return @param_names;
|
||||
|
||||
}
|
||||
|
||||
sub get_hex {
|
||||
|
||||
my $self = shift;
|
||||
my ($direction,$trunk_group_number,$trunk_member_number) = $self->_get_params(@_);
|
||||
die("invalid direction '$direction'") unless contains($direction,\@directions);
|
||||
die("invalid trunk group number '$trunk_group_number'") if length($trunk_group_number) != 4;
|
||||
die("invalid trunk member number '$trunk_member_number'") if length($trunk_member_number) != 4;
|
||||
return $direction . sprintf('%04d',$trunk_group_number) . sprintf('%04d',$trunk_member_number) . $TERMINATOR;
|
||||
|
||||
}
|
||||
|
||||
1;
|
@ -0,0 +1,45 @@
|
||||
package NGCP::BulkProcessor::Projects::Export::Ama::Format::Modules::Module000;
|
||||
use strict;
|
||||
|
||||
## no critic
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Module qw();
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::ModuleCode qw($MODULE_CODE_000);
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter NGCP::BulkProcessor::Projects::Export::Ama::Format::FieldSet NGCP::BulkProcessor::Projects::Export::Ama::Format::Module);
|
||||
our @EXPORT_OK = qw(
|
||||
$length
|
||||
);
|
||||
|
||||
our $length = 4;
|
||||
|
||||
sub new {
|
||||
|
||||
my $class = shift;
|
||||
my $self = NGCP::BulkProcessor::Projects::Export::Ama::Format::Module->new(
|
||||
$class,
|
||||
length => $length,
|
||||
#structure_name => $structure_name,
|
||||
@_);
|
||||
$self->{module_code} = NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::ModuleCode->new(
|
||||
module_code => $MODULE_CODE_000,
|
||||
@_,
|
||||
);
|
||||
$self->_add_field($self->{module_code});
|
||||
|
||||
return $self;
|
||||
|
||||
}
|
||||
|
||||
sub get_module_code_field {
|
||||
my $self = shift;
|
||||
return $self->{module_code};
|
||||
}
|
||||
|
||||
#sub get_instance {
|
||||
# return
|
||||
#}
|
||||
|
||||
1;
|
@ -1,4 +1,49 @@
|
||||
package NGCP::BulkProcessor::Projects::Export::Ama::Format::Modules::Module104;
|
||||
use strict;
|
||||
|
||||
## no critic
|
||||
|
||||
TRUNK_FACILITY_ID 129990000C
|
||||
TRUNK_FACILITY_ID 220140000C
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Module qw();
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::ModuleCode qw($MODULE_CODE_104);
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::TrunkIdentification qw();
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter NGCP::BulkProcessor::Projects::Export::Ama::Format::FieldSet NGCP::BulkProcessor::Projects::Export::Ama::Format::Module);
|
||||
our @EXPORT_OK = qw(
|
||||
$length
|
||||
);
|
||||
|
||||
our $length = 14;
|
||||
|
||||
sub new {
|
||||
|
||||
my $class = shift;
|
||||
my $self = NGCP::BulkProcessor::Projects::Export::Ama::Format::Module->new(
|
||||
$class,
|
||||
length => $length,
|
||||
#structure_name => $structure_name,
|
||||
@_);
|
||||
$self->{module_code} = NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::ModuleCode->new(
|
||||
module_code => $MODULE_CODE_104,
|
||||
@_,
|
||||
);
|
||||
$self->_add_field($self->{module_code});
|
||||
$self->_add_field(NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::TrunkIdentification->new(
|
||||
@_,
|
||||
));
|
||||
|
||||
return $self;
|
||||
|
||||
}
|
||||
|
||||
sub get_module_code_field {
|
||||
my $self = shift;
|
||||
return $self->{module_code};
|
||||
}
|
||||
|
||||
#sub get_instance {
|
||||
# return
|
||||
#}
|
||||
|
||||
1;
|
||||
|
@ -0,0 +1,53 @@
|
||||
package NGCP::BulkProcessor::Projects::Export::Ama::Format::Modules::Module199;
|
||||
use strict;
|
||||
|
||||
## no critic
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Module qw();
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::ModuleCode qw($MODULE_CODE_199);
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::DataDescriptor qw();
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::NetworkOperatorData qw();
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter NGCP::BulkProcessor::Projects::Export::Ama::Format::FieldSet NGCP::BulkProcessor::Projects::Export::Ama::Format::Module);
|
||||
our @EXPORT_OK = qw(
|
||||
$length
|
||||
);
|
||||
|
||||
our $length = 48;
|
||||
|
||||
sub new {
|
||||
|
||||
my $class = shift;
|
||||
my $self = NGCP::BulkProcessor::Projects::Export::Ama::Format::Module->new(
|
||||
$class,
|
||||
length => $length,
|
||||
#structure_name => $structure_name,
|
||||
@_);
|
||||
$self->{module_code} = NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::ModuleCode->new(
|
||||
module_code => $MODULE_CODE_199,
|
||||
@_,
|
||||
);
|
||||
$self->_add_field($self->{module_code});
|
||||
$self->_add_field(NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::DataDescriptor->new(
|
||||
@_,
|
||||
));
|
||||
$self->_add_field(NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::NetworkOperatorData->new(
|
||||
@_,
|
||||
));
|
||||
|
||||
return $self;
|
||||
|
||||
}
|
||||
|
||||
sub get_module_code_field {
|
||||
my $self = shift;
|
||||
return $self->{module_code};
|
||||
}
|
||||
|
||||
#sub get_instance {
|
||||
# return
|
||||
#}
|
||||
|
||||
1;
|
@ -0,0 +1,55 @@
|
||||
package NGCP::BulkProcessor::Projects::Export::Ama::Format::Modules::Module611;
|
||||
use strict;
|
||||
|
||||
## no critic
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Module qw();
|
||||
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::ModuleCode qw($MODULE_CODE_611);
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::GenericContextIdentifier qw();
|
||||
use NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::AdditionalDigitsDialed qw();
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter NGCP::BulkProcessor::Projects::Export::Ama::Format::FieldSet NGCP::BulkProcessor::Projects::Export::Ama::Format::Module);
|
||||
our @EXPORT_OK = qw(
|
||||
$length
|
||||
);
|
||||
|
||||
our $length = 28;
|
||||
|
||||
sub new {
|
||||
|
||||
my $class = shift;
|
||||
my $self = NGCP::BulkProcessor::Projects::Export::Ama::Format::Module->new(
|
||||
$class,
|
||||
length => $length,
|
||||
#structure_name => $structure_name,
|
||||
@_);
|
||||
$self->{module_code} = NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::ModuleCode->new(
|
||||
module_code => $MODULE_CODE_611,
|
||||
@_,
|
||||
);
|
||||
$self->_add_field($self->{module_code});
|
||||
$self->_add_field(NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::GenericContextIdentifier->new(
|
||||
#generic_context_identifier => $NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::GenericContextIdentifier::IN_CORRELATION_ID,
|
||||
#parsing_rules => '7',
|
||||
@_,
|
||||
));
|
||||
$self->_add_field(NGCP::BulkProcessor::Projects::Export::Ama::Format::Fields::AdditionalDigitsDialed->new(
|
||||
@_,
|
||||
));
|
||||
|
||||
return $self;
|
||||
|
||||
}
|
||||
|
||||
sub get_module_code_field {
|
||||
my $self = shift;
|
||||
return $self->{module_code};
|
||||
}
|
||||
|
||||
#sub get_instance {
|
||||
# return
|
||||
#}
|
||||
|
||||
1;
|
Loading…
Reference in new issue