+ #porting a number in? different code path
+ if ( $svc_phone->lnp_status eq 'portingin' ) {
+
+ my $cust_main = $svc_phone->cust_svc->cust_pkg->cust_main;
+
+ #return 'Customer company is required'
+ # unless $cust_main->company;
+
+ return 'Customer day phone (for contact, not porting) is required'
+ unless $cust_main->daytime;
+
+ return 'LNP Other Provider is required'
+ unless $svc_phone->lnp_other_provider;
+
+ return 'LNP Other Provider Account # is required'
+ unless $svc_phone->lnp_other_provider_account;
+
+ my %location = $svc_phone->location_hash;
+ my $sa = Geo::StreetAddress::US->parse_location( $location{'address1'} );
+
+ my $result = $self->vitelity_lnp_command('addport',
+ 'portnumber' => $svc_phone->phonenum,
+ 'partial' => 'no',
+ 'wireless' => 'no',
+ 'carrier' => $svc_phone->lnp_other_provider,
+ 'company' => $cust_main->company || $cust_main->contact,
+ 'accnumber' => $svc_phone->lnp_other_provider_account,
+ 'name' => $svc_phone->phone_name_or_cust,
+ 'streetnumber' => $sa->{number},
+ 'streetprefix' => $sa->{prefix},
+ 'streetname' => $sa->{street}. ' '. $sa->{type},
+ 'streetsuffix' => $sa->{suffix},
+ 'unit' => ( $sa->{sec_unit_num}
+ ? $sa->{sec_unit_type}. ' '. $sa->{sec_unit_num}
+ : ''
+ ),
+ 'city' => $location{'city'},
+ 'state' => $location{'state'},
+ 'zip' => $location{'zip'},
+ 'billnumber' => $svc_phone->phonenum, #?? do we need a new field for this?
+ 'contactnumber' => $cust_main->daytime,
+ );
+ warn "Vitelity response: $result" if $self->option('debug');
+
+ if ( $result =~ /^ok:/i ) {
+ my($ok, $portid, $sig, $bill) = split(':', $result);
+ $svc_phone->lnp_portid($portid);
+ $svc_phone->lnp_signature('Y') if $sig =~ /y/i;
+ $svc_phone->lnp_bill('Y') if $bill =~ /y/i;
+ local($FS::svc_Common::noexport_hack) = 1;
+ return $svc_phone->replace;
+ } else {
+ return "Error initiating Vitelity port: $result";
+ }
+
+ }
+