X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fvitelity.pm;h=574592ff84837e70910290f995d53ca9bb64b3fe;hp=4dd9caa5eb8fbbf0a0b056501b8a106ddf1b9e39;hb=0c7672759a3254c4bd7317edb23f40d8880d99d6;hpb=575dbfc4c5acb1dd2c04e17fd045351b240db218 diff --git a/FS/FS/part_export/vitelity.pm b/FS/FS/part_export/vitelity.pm index 4dd9caa5e..574592ff8 100644 --- a/FS/FS/part_export/vitelity.pm +++ b/FS/FS/part_export/vitelity.pm @@ -374,7 +374,7 @@ sub _export_insert { my $cnam_result = $self->vitelity_command('cnamenable', 'did'=>$svc_phone->phonenum, ); - if ( $result ne 'ok' ) { + if ( $result !~ /^(ok|success)/i ) { #we already provisioned the DID, so... warn "Vitelity error enabling CNAM for ". $svc_phone->phonenum. ": $result"; } elsif ( $self->option('debug') ) { @@ -387,7 +387,13 @@ sub _export_insert { my $e911_error = $self->e911_send($svc_phone); - if ( $e911_error =~ /^(missingdata|invalid)/i ) { + if ( $e911_error =~ /status=(missingdata|invalid)/i ) { + + my $status = $1; + if ( $e911_error =~ /error=(.*)/ ) { + $e911_error = "status=$status, error=$1"; + } + #but we already provisioned the DID, so: $self->vitelity_command('removedid', 'did'=> $svc_phone->phonenum,); #and check the results? if it failed, then what? @@ -404,6 +410,7 @@ sub e911_send { return '' if $self->option('disable_e911'); my %location = $svc_phone->location_hash; + $location{'zip'} =~ s/\-\d{4}$//; my %e911send = ( 'did' => $svc_phone->phonenum, 'name' => $svc_phone->phone_name_or_cust, @@ -419,7 +426,7 @@ sub e911_send { my $e911_result = $self->vitelity_command('e911send', %e911send); - unless ( $e911_result =~ /^(missingdata|invalid)/i ) { + unless ( $e911_result =~ /status=(missingdata|invalid)/i ) { warn "Vitelity response: $e911_result" if $self->option('debug'); return ''; }