tie %options, 'Tie::IxHash', (
'company_name' => { label => 'Company name for header record',
- type => 'text'
+ type => 'text',
},
'company_id' => { label => 'NENA company ID',
type => 'text',
'customer_code' => { label => 'Customer code',
type => 'text',
},
+ 'area_code' => { label => 'Default area code for 7 digit numbers',
+ type => 'text',
+ },
'prefix' => { label => 'File name prefix',
type => 'text',
},
my %hash = map { $_ => '' } @{ $item_format->names };
$hash{function_code} = $function_code{$action};
-
- # phone number
- $svc->phonenum =~ /^(\d{3})(\d*)$/;
+
+ # Add default area code if phonenum is 7 digits
+ my $phonenum = $svc->phonenum;
+ if ($self->option('area_code') =~ /^\d{3}$/ && $phonenum =~ /^\d{7}$/ ){
+ $phonenum = $self->option('area_code'). $svc->phonenum;
+ }
+
+ # phone number
+ $phonenum =~ /^(\d{3})(\d*)$/;
$hash{npa} = $1;
$hash{calling_number} = $2;