X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Fconvert-477-options;h=be37b4133b7bb9f799ade56b6b53d9a0dcaf5ba9;hp=99a6ea5e08153e3c26889922a8c936f4907c663b;hb=1f2021c9b76da7cc59e2a981fbac6b24312876d2;hpb=0f359d5480aa1621d73ee802f420e8951abc620d diff --git a/bin/convert-477-options b/bin/convert-477-options index 99a6ea5e0..be37b4133 100755 --- a/bin/convert-477-options +++ b/bin/convert-477-options @@ -92,6 +92,8 @@ sub report_option_to_fcc_option { } elsif ($formkey =~ /^part2b_row_option_(\d+)/) { #VoIP options (are all media types) push @return, (split(':', $voip_option[$1])); + } elsif ($formkey =~ /^part5_report_option/) { + # ignore this } else { warn "can't parse option with formkey '$formkey'\n"; } @@ -110,26 +112,32 @@ for my $part_pkg (qsearch('part_pkg', { freq => {op => '!=', value => '0'}})) { push @fcc_opts, report_option_to_fcc_option($num); } # other special stuff: - # FCC voice class (VoIP OTT, VoIP + broadband) - if ($part_pkg->fcc_voip_class == 1) { - push @fcc_opts, 'is_voip' => 1; - } elsif ( $part_pkg->fcc_voip_class == 2) { - push @fcc_opts, 'is_voip' => 1, 'is_broadband' => 1; - } - # DS0 equivalent lines - if ( $part_pkg->fcc_ds0s ) { - if ($part_pkg->fcc_voip_class) { - # there's no such thing as a VoIP DS0 equivalent, but this is - # what we used the field for - push @fcc_opts, 'voip_sessions' => $part_pkg->fcc_ds0s; + # FCC voice class (VoIP OTT, VoIP + broadband, Wholesale VoIP, Local + # Exchange) and DS0 equivalent lines + my $sessions = $part_pkg->fcc_ds0s; + + if ( $sessions ) { # then this is a voice package of some kind + if ($part_pkg->fcc_voip_class == 1) { + # VoIP OTT (connection not included) + push @fcc_opts, 'is_voip' => 1, 'voip_ott' => 1, + 'voip_sessions' => $sessions; + } elsif ( $part_pkg->fcc_voip_class == 2) { + # VoIP non-OTT; do not set is_broadband since the connection is not + # necessarily general Internet access + push @fcc_opts, 'is_voip' => 1, + 'voip_sessions' => $sessions; + } elsif ( $part_pkg->fcc_voip_class == 3 ) { + # wholesale VoIP; apparently no longer reportable? } else { - push @fcc_opts, 'phone_lines' => $part_pkg->fcc_ds0s, 'is_phone' => 1; + # local exchange telephone + push @fcc_opts, 'is_phone' => 1, + 'phone_lines' => $sessions; } } my %fcc_opts = @fcc_opts; #print map {"\t$_\t".$fcc_opts{$_}."\n"} keys %fcc_opts; - my $error = $part_pkg->process_fcc_options(\%fcc_opts); + my $error = $part_pkg->set_fcc_options(\%fcc_opts); if ( $error ) { die "$error\n"; }