4 use base qw( FS::svc_Domain_Mixin FS::location_Mixin FS::svc_Common );
5 use vars qw( $DEBUG $me @pw_set $conf $phone_name_max
6 $passwordmin $passwordmax
9 use Scalar::Util qw( blessed );
10 use List::Util qw( min );
13 use FS::Record qw( qsearch qsearchs dbh );
14 use FS::PagedSearch qw( psearch );
15 use FS::Msgcat qw(gettext);
20 use FS::cust_location;
23 $me = '[' . __PACKAGE__ . ']';
27 @pw_set = ( 'a'..'k', 'm','n', 'p-z', 'A'..'N', 'P'..'Z' , '2'..'9' );
29 #ask FS::UID to run this stuff for us later
30 FS::UID->install_callback( sub {
32 $phone_name_max = $conf->config('svc_phone-phone_name-max_length');
33 $passwordmin = $conf->config('sip_passwordmin') || 0;
34 $passwordmax = $conf->config('sip_passwordmax') || 80;
40 FS::svc_phone - Object methods for svc_phone records
46 $record = new FS::svc_phone \%hash;
47 $record = new FS::svc_phone { 'column' => 'value' };
49 $error = $record->insert;
51 $error = $new_record->replace($old_record);
53 $error = $record->delete;
55 $error = $record->check;
57 $error = $record->suspend;
59 $error = $record->unsuspend;
61 $error = $record->cancel;
65 An FS::svc_phone object represents a phone number. FS::svc_phone inherits
66 from FS::Record. The following fields are currently supported:
80 SIM IMSI (http://en.wikipedia.org/wiki/International_mobile_subscriber_identity)
92 Optional svcnum from svc_pbx
96 Forwarding destination
100 Email address for virtual fax (fax-to-email) services
104 LNP Status (can be null, native, portedin, portingin, portin-reject,
105 portingout, portout-reject)
111 =item lnp_desired_due_date
115 =item lnp_other_provider
117 If porting the number in or out, name of the losing or winning provider,
120 =item lnp_other_provider_account
122 Account number of other provider. See lnp_other_provider.
124 =item lnp_reject_reason
126 See lnp_status. If lnp_status is portin-reject or portout-reject, this is an
127 optional reject reason.
131 Class of Service for E911 service (per the NENA 2.1 standard).
135 Type of Service for E911 service.
145 Creates a new phone number. To add the number to the database, see L<"insert">.
147 Note that this stores the hash reference, not a distinct copy of the hash it
148 points to. You can ask the object for a copy with the I<hash> method.
152 # the new method can be inherited from FS::Record, if a table method is defined
155 my %dis2 = ( disable_inventory=>1, disable_select=>1 );
157 'name' => 'Phone number',
158 'sorts' => 'phonenum',
159 'display_weight' => 60,
160 'cancel_weight' => 80,
162 'svcnum' => 'Service',
163 'countrycode' => { label => 'Country code',
165 disable_inventory => 1,
168 'phonenum' => 'Phone number',
169 'sim_imsi' => 'IMSI', #http://en.wikipedia.org/wiki/International_mobile_subscriber_identity
170 'pin' => { label => 'Voicemail PIN', #'Personal Identification Number',
172 disable_inventory => 1,
175 'sip_password' => 'SIP password',
176 'phone_name' => 'Name',
177 'pbxsvc' => { label => 'PBX',
178 type => 'select-svc_pbx.html',
179 disable_inventory => 1,
180 disable_select => 1, #UI wonky, pry works otherwise
185 select_table => 'svc_domain',
186 select_key => 'svcnum',
187 select_label => 'domain',
188 disable_inventory => 1,
190 'circuit_svcnum' => { label => 'Circuit',
192 select_table => 'svc_domain',
193 select_key => 'svcnum',
194 select_label => 'circuit_label',
195 disable_inventory => 1,
198 'sms_carrierid' => { label => 'SMS Carrier',
200 select_table => 'cdr_carrier',
201 select_key => 'carrierid',
202 select_label => 'carriername',
203 disable_inventory => 1,
205 'sms_account' => { label => 'SMS Carrier Account', },
206 'max_simultaneous' => { label=>'Maximum number of simultaneous users' },
208 label => 'E911 location',
209 disable_inventory => 1,
212 'forwarddst' => { label => 'Forward Destination',
215 'email' => { label => 'Email',
218 'lnp_status' => { label => 'LNP Status',
219 type => 'select-lnp_status.html',
222 'lnp_reject_reason' => {
223 label => 'LNP Reject Reason',
226 'portable' => { label => 'Portable?', %dis2, },
227 'lrn' => { label => 'LRN',
228 disable_inventory => 1,
230 'lnp_desired_due_date' =>
231 { label => 'LNP Desired Due Date', %dis2 },
233 { label => 'LNP Due Date', %dis2 },
234 'lnp_other_provider' =>
235 { label => 'LNP Other Provider',
236 disable_inventory => 1,
238 'lnp_other_provider_account' =>
239 { label => 'LNP Other Provider Account #',
243 label => 'E911 Service Class',
244 type => 'select-e911_class',
245 disable_inventory => 1,
249 label => 'E911 Service Type',
250 type => 'select-e911_type',
251 disable_inventory => 1,
258 sub table { 'svc_phone'; }
260 sub table_dupcheck_fields { ( 'countrycode', 'phonenum' ); }
262 =item search_sql STRING
264 Class method which returns an SQL fragment to search for the given string.
269 my( $class, $string ) = @_;
271 #my $conf = new FS::Conf;
273 if ( $conf->exists('svc_phone-allow_alpha_phonenum') ) {
279 my $ccode = ( $conf->exists('default_phone_countrycode')
280 && $conf->config('default_phone_countrycode')
282 ? $conf->config('default_phone_countrycode')
285 $string =~ s/^$ccode//;
287 $class->search_sql_field('phonenum', $string );
292 Returns the phone number.
298 my $phonenum = $self->phonenum; #XXX format it better
299 my $label = $phonenum;
300 $label .= '@'.$self->domain if $self->domsvc;
301 $label .= ' ('.$self->phone_name.')' if $self->phone_name;
307 Adds this phone number to the database. If there is an error, returns the
308 error, otherwise returns false.
317 warn "[$me] insert called on $self: ". Dumper($self).
318 "\nwith options: ". Dumper(%options);
321 local $SIG{HUP} = 'IGNORE';
322 local $SIG{INT} = 'IGNORE';
323 local $SIG{QUIT} = 'IGNORE';
324 local $SIG{TERM} = 'IGNORE';
325 local $SIG{TSTP} = 'IGNORE';
326 local $SIG{PIPE} = 'IGNORE';
328 my $oldAutoCommit = $FS::UID::AutoCommit;
329 local $FS::UID::AutoCommit = 0;
332 #false laziness w/cust_pkg.pm... move this to location_Mixin? that would
333 #make it more of a base class than a mixin... :)
334 if ( $options{'cust_location'} ) {
335 my $error = $options{'cust_location'}->find_or_insert;
337 $dbh->rollback if $oldAutoCommit;
338 return "inserting cust_location (transaction rolled back): $error";
340 $self->locationnum( $options{'cust_location'}->locationnum );
342 #what about on-the-fly edits? if the ui supports it?
344 my $error = $self->SUPER::insert(%options);
346 $dbh->rollback if $oldAutoCommit;
350 $dbh->commit or die $dbh->errstr if $oldAutoCommit;
357 Delete this record from the database.
364 local $SIG{HUP} = 'IGNORE';
365 local $SIG{INT} = 'IGNORE';
366 local $SIG{QUIT} = 'IGNORE';
367 local $SIG{TERM} = 'IGNORE';
368 local $SIG{TSTP} = 'IGNORE';
369 local $SIG{PIPE} = 'IGNORE';
371 my $oldAutoCommit = $FS::UID::AutoCommit;
372 local $FS::UID::AutoCommit = 0;
375 foreach my $phone_device ( $self->phone_device ) {
376 my $error = $phone_device->delete;
378 $dbh->rollback if $oldAutoCommit;
383 my @phone_avail = qsearch('phone_avail', { 'svcnum' => $self->svcnum } );
384 foreach my $phone_avail ( @phone_avail ) {
385 $phone_avail->svcnum('');
386 my $error = $phone_avail->replace;
388 $dbh->rollback if $oldAutoCommit;
393 my $error = $self->SUPER::delete;
395 $dbh->rollback if $oldAutoCommit;
399 $dbh->commit or die $dbh->errstr if $oldAutoCommit;
404 # the delete method can be inherited from FS::Record
406 =item replace OLD_RECORD
408 Replaces the OLD_RECORD with this one in the database. If there is an error,
409 returns the error, otherwise returns false.
416 my $old = ( blessed($_[0]) && $_[0]->isa('FS::Record') )
423 warn "[$me] replacing $old with $new\n".
424 "\nwith options: ". Dumper(%options);
427 local $SIG{HUP} = 'IGNORE';
428 local $SIG{INT} = 'IGNORE';
429 local $SIG{QUIT} = 'IGNORE';
430 local $SIG{TERM} = 'IGNORE';
431 local $SIG{TSTP} = 'IGNORE';
432 local $SIG{PIPE} = 'IGNORE';
434 my $oldAutoCommit = $FS::UID::AutoCommit;
435 local $FS::UID::AutoCommit = 0;
438 #false laziness w/cust_pkg.pm... move this to location_Mixin? that would
439 #make it more of a base class than a mixin... :)
440 if ( $options{'cust_location'}
441 && ( ! $new->locationnum || $new->locationnum == -1 ) ) {
442 my $error = $options{'cust_location'}->insert;
444 $dbh->rollback if $oldAutoCommit;
445 return "inserting cust_location (transaction rolled back): $error";
447 $new->locationnum( $options{'cust_location'}->locationnum );
449 #what about on-the-fly edits? if the ui supports it?
451 # LNP data validation
452 return 'Invalid LNP status' # if someone does really stupid stuff
453 if ( ($old->lnp_status eq 'portingout' && $new->lnp_status eq 'portingin')
454 || ($old->lnp_status eq 'portout-reject' && $new->lnp_status eq 'portingin')
455 || ($old->lnp_status eq 'portin-reject' && $new->lnp_status eq 'portingout')
456 || ($old->lnp_status eq 'portingin' && $new->lnp_status eq 'native')
457 || ($old->lnp_status eq 'portin-reject' && $new->lnp_status eq 'native')
458 || ($old->lnp_status eq 'portingin' && $new->lnp_status eq 'portingout')
459 || ($old->lnp_status eq 'portingout' && $new->lnp_status eq 'portin-reject')
462 my $error = $new->SUPER::replace($old, %options);
464 # if this changed the e911 location, notify exports
465 if ($new->locationnum ne $old->locationnum) {
466 my $new_location = $new->cust_location_or_main;
467 my $old_location = $new->cust_location_or_main;
468 $error ||= $new->export('relocate', $new_location, $old_location);
472 $dbh->rollback if $oldAutoCommit;
473 return $error if $error;
477 $dbh->commit or die $dbh->errstr if $oldAutoCommit;
483 Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
487 Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
491 Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
495 Checks all fields to make sure this is a valid phone number. If there is
496 an error, returns the error, otherwise returns false. Called by the insert
501 # the check method should currently be supplied - FS::Record contains some
502 # data checking routines
507 #my $conf = new FS::Conf;
509 my $x = $self->setfixed;
510 return $x unless ref($x);
513 my $phonenum = $self->phonenum;
514 my $phonenum_check_method;
515 if ( $conf->exists('svc_phone-allow_alpha_phonenum') ) {
516 $phonenum =~ s/\W//g;
517 $phonenum_check_method = 'ut_alpha';
519 $phonenum =~ s/\D//g;
520 $phonenum_check_method = 'ut_number';
522 $self->phonenum($phonenum);
524 $self->locationnum('') if !$self->locationnum || $self->locationnum == -1;
527 $self->ut_numbern('svcnum')
528 || $self->ut_numbern('countrycode')
529 || $self->$phonenum_check_method('phonenum')
530 || $self->ut_numbern('sim_imsi')
531 || $self->ut_anything('sip_password')
532 || $self->ut_numbern('pin')
533 || $self->ut_textn('phone_name')
534 || $self->ut_foreign_keyn('pbxsvc', 'svc_pbx', 'svcnum' )
535 || $self->ut_foreign_keyn('domsvc', 'svc_domain', 'svcnum' )
536 || $self->ut_foreign_keyn('sms_carrierid', 'cdr_carrier', 'carrierid' )
537 || $self->ut_alphan('sms_account')
538 || $self->ut_numbern('max_simultaneous')
539 || $self->ut_foreign_keyn('locationnum', 'cust_location', 'locationnum')
540 || $self->ut_numbern('forwarddst')
541 || $self->ut_textn('email')
542 || $self->ut_numbern('lrn')
543 || $self->ut_numbern('lnp_desired_due_date')
544 || $self->ut_numbern('lnp_due_date')
545 || $self->ut_textn('lnp_other_provider')
546 || $self->ut_textn('lnp_other_provider_account')
547 || $self->ut_enumn('lnp_status', ['','portingin','portingout','portedin',
548 'native', 'portin-reject', 'portout-reject'])
549 || $self->ut_enumn('portable', ['','Y'])
550 || $self->ut_textn('lnp_reject_reason')
552 return $error if $error;
554 return 'Illegal IMSI (not 14-15 digits)' #shorter?
555 if length($self->sim_imsi)
556 && ( length($self->sim_imsi) < 14 || length($self->sim_imsi) > 15 );
558 # LNP data validation
559 return 'Cannot set LNP fields: no LNP in progress'
560 if ( ($self->lnp_desired_due_date || $self->lnp_due_date
561 || $self->lnp_other_provider || $self->lnp_other_provider_account
562 || $self->lnp_reject_reason)
563 && (!$self->lnp_status || $self->lnp_status eq 'native') );
564 return 'Cannot set LNP reject reason: no LNP in progress or status is not reject'
565 if ($self->lnp_reject_reason && (!$self->lnp_status
566 || $self->lnp_status !~ /^port(in|out)-reject$/) );
567 return 'Cannot port-out a non-portable number'
568 if (!$self->portable && $self->lnp_status eq 'portingout');
571 return 'Name ('. $self->phone_name.
572 ") is longer than $phone_name_max characters"
573 if $phone_name_max && length($self->phone_name) > $phone_name_max;
575 $self->countrycode(1) unless $self->countrycode;
577 unless ( length($self->pin) ) {
578 my $random_pin = $conf->config('svc_phone-random_pin');
579 if ( defined($random_pin) && $random_pin =~ /^\d+$/ ) {
581 join('', map int(rand(10)), 0..($random_pin-1))
586 if ( length($self->sip_password) ) {
588 return "SIP password must be longer than $passwordmin characters"
589 if length($self->sip_password) < $passwordmin;
590 return "SIP password must be shorter than $passwordmax characters"
591 if length($self->sip_password) > $passwordmax;
593 } elsif ( $part_svc->part_svc_column('sip_password')->columnflag ne 'F' ) {
597 join('', map $pw_set[ int(rand $#pw_set) ], (1..min($passwordmax,16)) )
602 if ($self->e911_class and !exists(e911_classes()->{$self->e911_class})) {
603 return "undefined e911 class '".$self->e911_class."'";
605 if ($self->e911_type and !exists(e911_types()->{$self->e911_type})) {
606 return "undefined e911 type '".$self->e911_type."'";
612 =item _check duplicate
614 Internal method to check for duplicate phone numers.
618 #false laziness w/svc_acct.pm's _check_duplicate.
619 sub _check_duplicate {
622 my $global_unique = $conf->config('global_unique-phonenum') || 'none';
623 return '' if $global_unique eq 'disabled';
628 grep { !$self->svcnum || $_->svcnum != $self->svcnum }
629 qsearch( 'svc_phone', {
630 'countrycode' => $self->countrycode,
631 'phonenum' => $self->phonenum,
634 return gettext('phonenum_in_use')
635 if $global_unique eq 'countrycode+phonenum' && @dup_ccphonenum;
637 my $part_svc = qsearchs('part_svc', { 'svcpart' => $self->svcpart } );
638 unless ( $part_svc ) {
639 return 'unknown svcpart '. $self->svcpart;
642 if ( @dup_ccphonenum ) {
644 my $exports = FS::part_export::export_info('svc_phone');
645 my %conflict_ccphonenum_svcpart = ( $self->svcpart => 'SELF', );
647 foreach my $part_export ( $part_svc->part_export ) {
649 #this will catch to the same exact export
650 my @svcparts = map { $_->svcpart } $part_export->export_svc;
652 $conflict_ccphonenum_svcpart{$_} = $part_export->exportnum
657 foreach my $dup_ccphonenum ( @dup_ccphonenum ) {
658 my $dup_svcpart = $dup_ccphonenum->cust_svc->svcpart;
659 if ( exists($conflict_ccphonenum_svcpart{$dup_svcpart}) ) {
660 return "duplicate phone number ".
661 $self->countrycode. ' '. $self->phonenum.
662 ": conflicts with svcnum ". $dup_ccphonenum->svcnum.
663 " via exportnum ". $conflict_ccphonenum_svcpart{$dup_svcpart};
675 Checks the supplied PIN against the PIN in the database. Returns true for a
676 sucessful authentication, false if no match.
681 my($self, $check_pin) = @_;
682 length($self->pin) && $check_pin eq $self->pin;
691 #XXX Session-Timeout! holy shit, need rlm_perl to ask for this in realtime
703 #my $conf = new FS::Conf;
706 if ( $conf->config('svc_phone-radius-password') eq 'countrycode_phonenum' ) {
707 $password = $self->countrycode. $self->phonenum;
709 $password = $conf->config('svc_phone-radius-default_password');
711 $check{'User-Password'} = $password;
720 =item sms_cdr_carrier
722 Returns the L<FS::cdr_carrier> assigned as the SMS carrier for this phone.
726 sub sms_cdr_carrier {
728 return '' unless $self->sms_carrierid;
729 qsearchs('cdr_carrier', { 'carrierid' => $self->sms_carrierid } );
732 =item sms_carriername
734 Returns the name of the SMS carrier, or an empty string if there isn't one.
738 sub sms_carriername {
740 my $cdr_carrier = $self->sms_cdr_carrier or return '';
741 $cdr_carrier->carriername;
746 Returns the L<FS::svc_circuit> assigned as the trunk for this phone line.
750 Returns the label of the circuit (the part_svc label followed by the
751 circuit ID), or an empty string if there isn't one.
757 my $svcnum = $self->get('circuit_svcnum') or return '';
758 return FS::svc_circuit->by_key($svcnum);
763 my $svc_circuit = $self->svc_circuit or return '';
764 return join(' ', $svc_circuit->part_svc->svc, $svc_circuit->circuit_id);
769 Returns any FS::phone_device records associated with this service.
775 qsearch('phone_device', { 'svcnum' => $self->svcnum } );
778 #override location_Mixin version cause we want to try the cust_pkg location
779 #in between us and cust_main
780 # XXX what to do in the unlinked case??? return a pseudo-object that returns
782 sub cust_location_or_main {
784 return $self->cust_location if $self->locationnum;
785 my $cust_pkg = $self->cust_svc->cust_pkg;
786 $cust_pkg ? $cust_pkg->cust_location_or_main : '';
789 =item phone_name_or_cust
791 Returns the C<phone_name> field if it has a value, or the package contact
792 name if there is one, or the customer contact name.
796 sub phone_name_or_cust {
798 if ( $self->phone_name ) {
799 return $self->phone_name;
801 my $cust_pkg = $self->cust_svc->cust_pkg or return '';
802 if ( $cust_pkg->contactnum ) {
803 return $cust_pkg->contact->firstlast;
805 return $cust_pkg->cust_main->name_short;
809 =item psearch_cdrs OPTIONS
811 Returns a paged search (L<FS::PagedSearch>) for Call Detail Records
812 associated with this service. By default, "associated with" means that
813 either the "src" or the "charged_party" field of the CDR matches the
814 "phonenum" field of the service. To access the CDRs themselves, call
815 "->fetch" on the resulting object.
819 Accepts the following options:
821 =item for_update => 1: SELECT the CDRs "FOR UPDATE".
823 =item status => "" (or "processing-tiered", "done"): Return only CDRs with that processing status.
825 =item inbound => 1: Return CDRs for inbound calls (that is, those that match
826 on 'dst'). With "status", will filter on inbound processing status.
828 =item default_prefix => "XXX": Also accept the phone number of the service prepended
829 with the chosen prefix.
831 =item begin, end: Start and end of a date range, as unix timestamp.
833 =item cdrtypenum: Only return CDRs with this type.
835 =item calltypenum: Only return CDRs with this call type.
837 =item disable_src => 1: Only match on 'charged_party', not 'src'.
839 =item disable_charged_party => 1: Only match on 'src', not 'charged_party'.
841 =item nonzero: Only return CDRs where duration > 0.
843 =item by_svcnum: not supported for svc_phone
845 =item billsec_sum: Instead of returning all of the CDRs, return a single
846 record (as an L<FS::cdr> object) with the sum of the 'billsec' field over
847 the entire result set.
855 my($self, %options) = @_;
860 if ( $options{'inbound'} ) {
863 if ( exists($options{'status'}) ) {
864 my $status = $options{'status'};
866 push @where, 'EXISTS ( SELECT 1 FROM cdr_termination '.
867 'WHERE cdr.acctid = cdr_termination.acctid '.
868 "AND cdr_termination.status = '$status' ". #quoting kludge
869 'AND cdr_termination.termpart = 1 )';
871 push @where, 'NOT EXISTS ( SELECT 1 FROM cdr_termination '.
872 'WHERE cdr.acctid = cdr_termination.acctid '.
873 'AND cdr_termination.termpart = 1 )';
879 push @fields, 'charged_party' unless $options{'disable_charged_party'};
880 push @fields, 'src' unless $options{'disable_src'};
881 $hash{'freesidestatus'} = $options{'status'}
882 if exists($options{'status'});
885 if ($options{'cdrtypenum'}) {
886 $hash{'cdrtypenum'} = $options{'cdrtypenum'};
888 if ($options{'calltypenum'}) {
889 $hash{'calltypenum'} = $options{'calltypenum'};
892 my $for_update = $options{'for_update'} ? 'FOR UPDATE' : '';
894 my $number = $self->phonenum;
896 my $prefix = $options{'default_prefix'};
898 my @orwhere = map " $_ = '$number' ", @fields;
899 push @orwhere, map " $_ = '$prefix$number' ", @fields
900 if defined($prefix) && length($prefix);
901 if ( $prefix && $prefix =~ /^\+(\d+)$/ ) {
902 push @orwhere, map " $_ = '$1$number' ", @fields
905 push @where, ' ( '. join(' OR ', @orwhere ). ' ) ';
907 if ( $options{'begin'} ) {
908 push @where, 'startdate >= '. $options{'begin'};
910 if ( $options{'end'} ) {
911 push @where, 'startdate < '. $options{'end'};
913 if ( $options{'nonzero'} ) {
914 push @where, 'duration > 0';
917 my $extra_sql = ( keys(%hash) ? ' AND ' : ' WHERE ' ). join(' AND ', @where );
922 'extra_sql' => $extra_sql,
923 'order_by' => $options{'billsec_sum'} ? '' : "ORDER BY startdate $for_update",
924 'select' => $options{'billsec_sum'} ? 'sum(billsec) as billsec_sum' : '*',
928 =item get_cdrs (DEPRECATED)
930 Like psearch_cdrs, but returns all the L<FS::cdr> objects at once, in a
931 single list. Arguments are the same as for psearch_cdrs. This can take
932 an unreasonably large amount of memory and is best avoided.
938 my $psearch = $self->psearch_cdrs(@_);
939 qsearch ( $psearch->{query} )
944 Takes the same options as psearch_cdrs, but returns a single row containing
945 "count" (the number of CDRs) and the sums of the following fields: duration,
946 billsec, rated_price, rated_seconds, rated_minutes.
948 Note that if any calls are not rated, their rated_* fields will be null.
949 If you want to use those fields, pass the 'status' option to limit to
950 calls that have been rated. This is intentional; please don't "fix" it.
956 my $psearch = $self->psearch_cdrs(@_);
957 $psearch->{query}->{'select'} = join(',',
959 map { "SUM($_) AS $_" }
960 qw(duration billsec rated_price rated_seconds rated_minutes)
963 $psearch->{query}->{'extra_sql'} =~ s/ ORDER BY.*$//;
964 qsearchs ( $psearch->{query} );
975 Returns a hashref of allowed values and descriptions for the C<e911_class>
980 Returns a hashref of allowed values and descriptions for the C<e911_type>
986 tie my %x, 'Tie::IxHash', (
989 3 => 'Residence PBX',
992 6 => 'Coin 1 Way out',
995 9 => 'Residence OPX',
997 A => 'Customer Operated Coin Telephone',
999 G => 'Wireless Phase I',
1000 H => 'Wireless Phase II',
1001 I => 'Wireless Phase II with Phase I information',
1002 V => 'VoIP Services Default',
1003 C => 'VoIP Residence',
1004 D => 'VoIP Business',
1005 E => 'VoIP Coin/Pay Phone',
1006 F => 'VoIP Wireless',
1007 J => 'VoIP Nomadic',
1008 K => 'VoIP Enterprise Services',
1015 tie my %x, 'Tie::IxHash', (
1016 0 => 'Not FX nor Non-Published',
1017 1 => 'FX in 911 serving area',
1018 2 => 'FX outside 911 serving area',
1019 3 => 'Non-Published',
1020 4 => 'Non-Published FX in serving area',
1021 5 => 'Non-Published FX outside serving area',
1022 6 => 'Local Ported Number',
1023 7 => 'Interim Ported Number',
1034 L<FS::svc_Common>, L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>,
1035 L<FS::cust_pkg>, schema.html from the base documentation.