2 use base qw( FS::svc_Domain_Mixin FS::svc_PBX_Mixin
8 use vars qw( $DEBUG $me @pw_set $conf $phone_name_max
9 $passwordmin $passwordmax
12 use Scalar::Util qw( blessed );
13 use List::Util qw( min );
16 use FS::Record qw( qsearch qsearchs dbh );
17 use FS::PagedSearch qw( psearch );
18 use FS::Msgcat qw(gettext);
22 use FS::cust_location;
25 $me = '[' . __PACKAGE__ . ']';
29 @pw_set = ( 'a'..'k', 'm','n', 'p-z', 'A'..'N', 'P'..'Z' , '2'..'9' );
31 #ask FS::UID to run this stuff for us later
32 FS::UID->install_callback( sub {
34 $phone_name_max = $conf->config('svc_phone-phone_name-max_length');
35 $passwordmin = $conf->config('sip_passwordmin') || 0;
36 $passwordmax = $conf->config('sip_passwordmax') || 80;
42 FS::svc_phone - Object methods for svc_phone records
48 $record = new FS::svc_phone \%hash;
49 $record = new FS::svc_phone { 'column' => 'value' };
51 $error = $record->insert;
53 $error = $new_record->replace($old_record);
55 $error = $record->delete;
57 $error = $record->check;
59 $error = $record->suspend;
61 $error = $record->unsuspend;
63 $error = $record->cancel;
67 An FS::svc_phone object represents a phone number. FS::svc_phone inherits
68 from FS::Record. The following fields are currently supported:
82 SIM IMSI (http://en.wikipedia.org/wiki/International_mobile_subscriber_identity)
94 Optional svcnum from svc_pbx
98 Forwarding destination
102 Email address for virtual fax (fax-to-email) services
106 LNP Status (can be null, native, portedin, portingin, portin-reject,
107 portingout, portout-reject)
113 =item lnp_desired_due_date
117 =item lnp_other_provider
119 If porting the number in or out, name of the losing or winning provider,
122 =item lnp_other_provider_account
124 Account number of other provider. See lnp_other_provider.
126 =item lnp_reject_reason
128 See lnp_status. If lnp_status is portin-reject or portout-reject, this is an
129 optional reject reason.
133 Class of Service for E911 service (per the NENA 2.1 standard).
137 Type of Service for E911 service.
141 The L<FS::svc_circuit> record for the physical circuit that transports this
146 The hostname of the SIP server that this phone number is routed to.
156 Creates a new phone number. To add the number to the database, see L<"insert">.
158 Note that this stores the hash reference, not a distinct copy of the hash it
159 points to. You can ask the object for a copy with the I<hash> method.
163 # the new method can be inherited from FS::Record, if a table method is defined
166 my %dis2 = ( disable_inventory=>1, disable_select=>1 );
168 'name' => 'Phone number',
169 'sorts' => 'phonenum',
170 'display_weight' => 60,
171 'cancel_weight' => 80,
173 'svcnum' => 'Service',
174 'countrycode' => { label => 'Country code',
176 disable_inventory => 1,
179 'phonenum' => 'Phone number',
180 'sim_imsi' => 'IMSI', #http://en.wikipedia.org/wiki/International_mobile_subscriber_identity
181 'pin' => { label => 'Voicemail PIN', #'Personal Identification Number',
183 disable_inventory => 1,
186 'sip_password' => 'SIP password',
187 'phone_name' => 'Name',
188 'pbxsvc' => { label => 'PBX',
189 type => 'select-svc_pbx.html',
190 disable_inventory => 1,
191 disable_select => 1, #UI wonky, pry works otherwise
196 select_table => 'svc_domain',
197 select_key => 'svcnum',
198 select_label => 'domain',
199 select_allow_empty => 1,
200 disable_inventory => 1,
202 'circuit_svcnum' => { label => 'Circuit',
204 select_table => 'svc_circuit',
205 select_key => 'svcnum',
206 select_label => 'label',
207 select_allow_empty=> 1,
208 disable_inventory => 1,
211 'sms_carrierid' => { label => 'SMS Carrier',
213 select_table => 'cdr_carrier',
214 select_key => 'carrierid',
215 select_label => 'carriername',
216 disable_inventory => 1,
218 'sms_account' => { label => 'SMS Carrier Account', },
219 'max_simultaneous' => { label=>'Maximum number of simultaneous users' },
221 label => 'E911 location',
222 disable_inventory => 1,
225 'forwarddst' => { label => 'Forward Destination',
228 'email' => { label => 'Email',
231 'lnp_status' => { label => 'LNP Status',
232 type => 'select-lnp_status.html',
235 'lnp_reject_reason' => {
236 label => 'LNP Reject Reason',
239 'portable' => { label => 'Portable?', %dis2, },
240 'lrn' => { label => 'LRN',
241 disable_inventory => 1,
243 'lnp_desired_due_date' =>
244 { label => 'LNP Desired Due Date', %dis2 },
246 { label => 'LNP Due Date', %dis2 },
247 'lnp_other_provider' =>
248 { label => 'LNP Other Provider',
249 disable_inventory => 1,
251 'lnp_other_provider_account' =>
252 { label => 'LNP Other Provider Account #',
256 label => 'E911 Service Class',
257 type => 'select-e911_class',
258 disable_inventory => 1,
262 label => 'E911 Service Type',
263 type => 'select-e911_type',
264 disable_inventory => 1,
275 sub table { 'svc_phone'; }
277 sub table_dupcheck_fields { ( 'countrycode', 'phonenum' ); }
279 =item search_sql STRING
281 Class method which returns an SQL fragment to search for the given string.
286 my( $class, $string ) = @_;
288 #my $conf = new FS::Conf;
290 if ( $conf->exists('svc_phone-allow_alpha_phonenum') ) {
296 my $ccode = ( $conf->exists('default_phone_countrycode')
297 && $conf->config('default_phone_countrycode')
299 ? $conf->config('default_phone_countrycode')
302 $string =~ s/^$ccode//;
304 $class->search_sql_field('phonenum', $string );
309 Returns the phone number.
315 my $phonenum = $self->phonenum; #XXX format it better
316 my $label = $phonenum;
317 $label .= '@'.$self->domain if $self->domsvc;
318 $label .= ' ('.$self->phone_name.')' if $self->phone_name;
324 Adds this phone number to the database. If there is an error, returns the
325 error, otherwise returns false.
329 sub preinsert_hook_first {
330 my( $self, %options ) = @_;
332 return '' unless $options{'cust_location'};
334 #false laziness w/cust_pkg.pm... move this to location_Mixin? that would
335 #make it more of a base class than a mixin... :)
336 $options{'cust_location'}->custnum( $self->cust_svc->cust_pkg->custnum );
337 my $error = $options{'cust_location'}->find_or_insert;
338 return "inserting cust_location (transaction rolled back): $error"
340 $self->locationnum( $options{'cust_location'}->locationnum );
341 #what about on-the-fly edits? if the ui supports it?
349 Delete this record from the database.
356 local $SIG{HUP} = 'IGNORE';
357 local $SIG{INT} = 'IGNORE';
358 local $SIG{QUIT} = 'IGNORE';
359 local $SIG{TERM} = 'IGNORE';
360 local $SIG{TSTP} = 'IGNORE';
361 local $SIG{PIPE} = 'IGNORE';
363 my $oldAutoCommit = $FS::UID::AutoCommit;
364 local $FS::UID::AutoCommit = 0;
367 foreach my $phone_device ( $self->phone_device ) {
368 my $error = $phone_device->delete;
370 $dbh->rollback if $oldAutoCommit;
375 my @phone_avail = qsearch('phone_avail', { 'svcnum' => $self->svcnum } );
376 foreach my $phone_avail ( @phone_avail ) {
377 $phone_avail->svcnum('');
378 my $error = $phone_avail->replace;
380 $dbh->rollback if $oldAutoCommit;
385 my $error = $self->SUPER::delete;
387 $dbh->rollback if $oldAutoCommit;
391 $dbh->commit or die $dbh->errstr if $oldAutoCommit;
396 =item replace OLD_RECORD
398 Replaces the OLD_RECORD with this one in the database. If there is an error,
399 returns the error, otherwise returns false.
406 my $old = ( blessed($_[0]) && $_[0]->isa('FS::Record') )
413 warn "[$me] replacing $old with $new\n".
414 "\nwith options: ". Dumper(%options);
417 local $SIG{HUP} = 'IGNORE';
418 local $SIG{INT} = 'IGNORE';
419 local $SIG{QUIT} = 'IGNORE';
420 local $SIG{TERM} = 'IGNORE';
421 local $SIG{TSTP} = 'IGNORE';
422 local $SIG{PIPE} = 'IGNORE';
424 my $oldAutoCommit = $FS::UID::AutoCommit;
425 local $FS::UID::AutoCommit = 0;
428 #false laziness w/cust_pkg.pm... move this to location_Mixin? that would
429 #make it more of a base class than a mixin... :)
430 if ( $options{'cust_location'}
431 && ( ! $new->locationnum || $new->locationnum == -1 ) ) {
432 my $error = $options{'cust_location'}->insert;
434 $dbh->rollback if $oldAutoCommit;
435 return "inserting cust_location (transaction rolled back): $error";
437 $new->locationnum( $options{'cust_location'}->locationnum );
439 #what about on-the-fly edits? if the ui supports it?
441 # LNP data validation
442 return 'Invalid LNP status' # if someone does really stupid stuff
443 if ( ($old->lnp_status eq 'portingout' && $new->lnp_status eq 'portingin')
444 || ($old->lnp_status eq 'portout-reject' && $new->lnp_status eq 'portingin')
445 || ($old->lnp_status eq 'portin-reject' && $new->lnp_status eq 'portingout')
446 || ($old->lnp_status eq 'portingin' && $new->lnp_status eq 'native')
447 || ($old->lnp_status eq 'portin-reject' && $new->lnp_status eq 'native')
448 || ($old->lnp_status eq 'portingin' && $new->lnp_status eq 'portingout')
449 || ($old->lnp_status eq 'portingout' && $new->lnp_status eq 'portin-reject')
452 my $error = $new->SUPER::replace($old, %options);
454 # if this changed the e911 location, notify exports
455 if ($new->locationnum ne $old->locationnum) {
456 my $new_location = $new->cust_location_or_main;
457 my $old_location = $new->cust_location_or_main;
458 $error ||= $new->export('relocate', $new_location, $old_location);
462 $dbh->rollback if $oldAutoCommit;
463 return $error if $error;
467 $dbh->commit or die $dbh->errstr if $oldAutoCommit;
473 Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
477 Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
481 Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
485 Checks all fields to make sure this is a valid phone number. If there is
486 an error, returns the error, otherwise returns false. Called by the insert
491 # the check method should currently be supplied - FS::Record contains some
492 # data checking routines
497 #my $conf = new FS::Conf;
499 my $x = $self->setfixed;
500 return $x unless ref($x);
503 my $phonenum = $self->phonenum;
504 my $phonenum_check_method;
505 if ( $conf->exists('svc_phone-allow_alpha_phonenum') ) {
506 $phonenum =~ s/\W//g;
507 $phonenum_check_method = 'ut_alpha';
509 $phonenum =~ s/\D//g;
510 $phonenum_check_method = 'ut_number';
512 $self->phonenum($phonenum);
514 $self->locationnum('') if !$self->locationnum || $self->locationnum == -1;
517 $self->ut_numbern('svcnum')
518 || $self->ut_numbern('countrycode')
519 || $self->$phonenum_check_method('phonenum')
520 || $self->ut_numbern('sim_imsi')
521 || $self->ut_anything('sip_password')
522 || $self->ut_numbern('pin')
523 || $self->ut_textn('phone_name')
524 || $self->ut_foreign_keyn('pbxsvc', 'svc_pbx', 'svcnum' )
525 || $self->ut_foreign_keyn('domsvc', 'svc_domain', 'svcnum' )
526 || $self->ut_foreign_keyn('sms_carrierid', 'cdr_carrier', 'carrierid' )
527 || $self->ut_alphan('sms_account')
528 || $self->ut_numbern('max_simultaneous')
529 || $self->ut_foreign_keyn('locationnum', 'cust_location', 'locationnum')
530 || $self->ut_numbern('forwarddst')
531 || $self->ut_textn('email')
532 || $self->ut_numbern('lrn')
533 || $self->ut_numbern('lnp_desired_due_date')
534 || $self->ut_numbern('lnp_due_date')
535 || $self->ut_textn('lnp_other_provider')
536 || $self->ut_textn('lnp_other_provider_account')
537 || $self->ut_enumn('lnp_status', ['','portingin','portingout','portedin',
538 'native', 'portin-reject', 'portout-reject'])
539 || $self->ut_enumn('portable', ['','Y'])
540 || $self->ut_textn('lnp_reject_reason')
541 || $self->ut_domainn('sip_server')
543 return $error if $error;
545 return 'Illegal IMSI (not 14-15 digits)' #shorter?
546 if length($self->sim_imsi)
547 && ( length($self->sim_imsi) < 14 || length($self->sim_imsi) > 15 );
549 # LNP data validation
550 return 'Cannot set LNP fields: no LNP in progress'
551 if ( ($self->lnp_desired_due_date || $self->lnp_due_date
552 || $self->lnp_other_provider || $self->lnp_other_provider_account
553 || $self->lnp_reject_reason)
554 && (!$self->lnp_status || $self->lnp_status eq 'native') );
555 return 'Cannot set LNP reject reason: no LNP in progress or status is not reject'
556 if ($self->lnp_reject_reason && (!$self->lnp_status
557 || $self->lnp_status !~ /^port(in|out)-reject$/) );
558 return 'Cannot port-out a non-portable number'
559 if (!$self->portable && $self->lnp_status eq 'portingout');
562 return 'Name ('. $self->phone_name.
563 ") is longer than $phone_name_max characters"
564 if $phone_name_max && length($self->phone_name) > $phone_name_max;
566 $self->countrycode(1) unless $self->countrycode;
568 unless ( length($self->pin) ) {
569 my $random_pin = $conf->config('svc_phone-random_pin');
570 if ( defined($random_pin) && $random_pin =~ /^\d+$/ ) {
572 join('', map int(rand(10)), 0..($random_pin-1))
577 if ( length($self->sip_password) ) {
579 return "SIP password must be longer than $passwordmin characters"
580 if length($self->sip_password) < $passwordmin;
581 return "SIP password must be shorter than $passwordmax characters"
582 if length($self->sip_password) > $passwordmax;
584 } elsif ( $part_svc->part_svc_column('sip_password')->columnflag ne 'F' ) {
588 join('', map $pw_set[ int(rand $#pw_set) ], (1..min($passwordmax,16)) )
593 if ($self->e911_class and !exists(e911_classes()->{$self->e911_class})) {
594 return "undefined e911 class '".$self->e911_class."'";
596 if ($self->e911_type and !exists(e911_types()->{$self->e911_type})) {
597 return "undefined e911 type '".$self->e911_type."'";
603 =item _check duplicate
605 Internal method to check for duplicate phone numers.
609 #false laziness w/svc_acct.pm's _check_duplicate.
610 sub _check_duplicate {
613 my $global_unique = $conf->config('global_unique-phonenum') || 'none';
614 return '' if $global_unique eq 'disabled';
619 grep { !$self->svcnum || $_->svcnum != $self->svcnum }
620 qsearch( 'svc_phone', {
621 'countrycode' => $self->countrycode,
622 'phonenum' => $self->phonenum,
625 return gettext('phonenum_in_use')
626 if $global_unique eq 'countrycode+phonenum' && @dup_ccphonenum;
628 my $part_svc = qsearchs('part_svc', { 'svcpart' => $self->svcpart } );
629 unless ( $part_svc ) {
630 return 'unknown svcpart '. $self->svcpart;
633 if ( @dup_ccphonenum ) {
635 my $exports = FS::part_export::export_info('svc_phone');
636 my %conflict_ccphonenum_svcpart = ( $self->svcpart => 'SELF', );
638 foreach my $part_export ( $part_svc->part_export ) {
640 #this will catch to the same exact export
641 my @svcparts = map { $_->svcpart } $part_export->export_svc;
643 $conflict_ccphonenum_svcpart{$_} = $part_export->exportnum
648 foreach my $dup_ccphonenum ( @dup_ccphonenum ) {
649 my $dup_svcpart = $dup_ccphonenum->cust_svc->svcpart;
650 if ( exists($conflict_ccphonenum_svcpart{$dup_svcpart}) ) {
651 return "duplicate phone number ".
652 $self->countrycode. ' '. $self->phonenum.
653 ": conflicts with svcnum ". $dup_ccphonenum->svcnum.
654 " via exportnum ". $conflict_ccphonenum_svcpart{$dup_svcpart};
666 Checks the supplied PIN against the PIN in the database. Returns true for a
667 sucessful authentication, false if no match.
672 my($self, $check_pin) = @_;
673 length($self->pin) && $check_pin eq $self->pin;
682 #XXX Session-Timeout! holy shit, need rlm_perl to ask for this in realtime
694 #my $conf = new FS::Conf;
697 if ( $conf->config('svc_phone-radius-password') eq 'countrycode_phonenum' ) {
698 $password = $self->countrycode. $self->phonenum;
700 $password = $conf->config('svc_phone-radius-default_password');
702 $check{'User-Password'} = $password;
711 =item sms_cdr_carrier
713 Returns the L<FS::cdr_carrier> assigned as the SMS carrier for this phone.
717 sub sms_cdr_carrier {
719 return '' unless $self->sms_carrierid;
720 qsearchs('cdr_carrier', { 'carrierid' => $self->sms_carrierid } );
723 =item sms_carriername
725 Returns the name of the SMS carrier, or an empty string if there isn't one.
729 sub sms_carriername {
731 my $cdr_carrier = $self->sms_cdr_carrier or return '';
732 $cdr_carrier->carriername;
737 Returns the L<FS::svc_circuit> assigned as the trunk for this phone line.
741 Returns the label of the circuit (the part_svc label followed by the
742 circuit ID), or an empty string if there isn't one.
748 my $svcnum = $self->get('circuit_svcnum') or return '';
749 return FS::svc_circuit->by_key($svcnum);
754 my $svc_circuit = $self->svc_circuit or return '';
755 return join(' ', $svc_circuit->part_svc->svc, $svc_circuit->circuit_id);
760 Returns any FS::phone_device records associated with this service.
764 #override location_Mixin version cause we want to try the cust_pkg location
765 #in between us and cust_main
766 # XXX what to do in the unlinked case??? return a pseudo-object that returns
768 sub cust_location_or_main {
770 return $self->cust_location if $self->locationnum;
771 my $cust_pkg = $self->cust_svc->cust_pkg;
772 $cust_pkg ? $cust_pkg->cust_location_or_main : '';
775 =item phone_name_or_cust
777 Returns the C<phone_name> field if it has a value, or the package contact
778 name if there is one, or the customer contact name.
782 sub phone_name_or_cust {
784 if ( $self->phone_name ) {
785 return $self->phone_name;
787 my $cust_pkg = $self->cust_svc->cust_pkg or return '';
788 if ( $cust_pkg->contactnum ) {
789 return $cust_pkg->contact->firstlast;
791 return $cust_pkg->cust_main->name_short;
795 =item psearch_cdrs OPTIONS
797 Returns a paged search (L<FS::PagedSearch>) for Call Detail Records
798 associated with this service. By default, "associated with" means that
799 either the "src" or the "charged_party" field of the CDR matches the
800 "phonenum" field of the service. To access the CDRs themselves, call
801 "->fetch" on the resulting object.
805 Accepts the following options:
807 =item for_update => 1: SELECT the CDRs "FOR UPDATE".
809 =item status => "" (or "processing-tiered", "done"): Return only CDRs with that processing status.
811 =item inbound => 1: Return CDRs for inbound calls (that is, those that match
812 on 'dst'). With "status", will filter on inbound processing status.
814 =item default_prefix => "XXX": Also accept the phone number of the service prepended
815 with the chosen prefix.
817 =item begin, end: Start and end of a date range, as unix timestamp.
819 =item cdrtypenum: Only return CDRs with this type.
821 =item calltypenum: Only return CDRs with this call type.
823 =item disable_src => 1: Only match on 'charged_party', not 'src'.
825 =item disable_charged_party => 1: Only match on 'src', not 'charged_party'.
827 =item nonzero: Only return CDRs where duration > 0.
829 =item by_svcnum: not supported for svc_phone
831 =item billsec_sum: Instead of returning all of the CDRs, return a single
832 record (as an L<FS::cdr> object) with the sum of the 'billsec' field over
833 the entire result set.
841 my($self, %options) = @_;
846 if ( $options{'inbound'} ) {
849 if ( exists($options{'status'}) ) {
850 my $status = $options{'status'};
852 push @where, 'EXISTS ( SELECT 1 FROM cdr_termination '.
853 'WHERE cdr.acctid = cdr_termination.acctid '.
854 "AND cdr_termination.status = '$status' ". #quoting kludge
855 'AND cdr_termination.termpart = 1 )';
857 push @where, 'NOT EXISTS ( SELECT 1 FROM cdr_termination '.
858 'WHERE cdr.acctid = cdr_termination.acctid '.
859 'AND cdr_termination.termpart = 1 )';
865 push @fields, 'charged_party' unless $options{'disable_charged_party'};
866 push @fields, 'src' unless $options{'disable_src'};
867 $hash{'freesidestatus'} = $options{'status'}
868 if exists($options{'status'});
871 if ($options{'cdrtypenum'}) {
872 $hash{'cdrtypenum'} = $options{'cdrtypenum'};
874 if ($options{'calltypenum'}) {
875 $hash{'calltypenum'} = $options{'calltypenum'};
878 my $for_update = $options{'for_update'} ? 'FOR UPDATE' : '';
880 my $number = $self->phonenum;
882 my $prefix = $options{'default_prefix'};
884 my @orwhere = map " $_ = '$number' ", @fields;
885 push @orwhere, map " $_ = '$prefix$number' ", @fields
886 if defined($prefix) && length($prefix);
887 if ( $prefix && $prefix =~ /^\+(\d+)$/ ) {
888 push @orwhere, map " $_ = '$1$number' ", @fields
891 push @where, ' ( '. join(' OR ', @orwhere ). ' ) ';
893 if ( $options{'begin'} ) {
894 push @where, 'startdate >= '. $options{'begin'};
896 if ( $options{'end'} ) {
897 push @where, 'startdate < '. $options{'end'};
899 if ( $options{'nonzero'} ) {
900 push @where, 'duration > 0';
903 my $extra_sql = ( keys(%hash) ? ' AND ' : ' WHERE ' ). join(' AND ', @where );
908 'extra_sql' => $extra_sql,
909 'order_by' => $options{'billsec_sum'} ? '' : "ORDER BY startdate $for_update",
910 'select' => $options{'billsec_sum'} ? 'sum(billsec) as billsec_sum' : '*',
914 =item get_cdrs (DEPRECATED)
916 Like psearch_cdrs, but returns all the L<FS::cdr> objects at once, in a
917 single list. Arguments are the same as for psearch_cdrs. This can take
918 an unreasonably large amount of memory and is best avoided.
924 my $psearch = $self->psearch_cdrs(@_);
925 qsearch ( $psearch->{query} )
930 Takes the same options as psearch_cdrs, but returns a single row containing
931 "count" (the number of CDRs) and the sums of the following fields: duration,
932 billsec, rated_price, rated_seconds, rated_minutes.
934 Note that if any calls are not rated, their rated_* fields will be null.
935 If you want to use those fields, pass the 'status' option to limit to
936 calls that have been rated. This is intentional; please don't "fix" it.
942 my $psearch = $self->psearch_cdrs(@_);
943 $psearch->{query}->{'select'} = join(',',
945 map { "SUM($_) AS $_" }
946 qw(duration billsec rated_price rated_seconds rated_minutes)
949 $psearch->{query}->{'extra_sql'} =~ s/ ORDER BY.*$//;
950 qsearchs ( $psearch->{query} );
961 Returns a hashref of allowed values and descriptions for the C<e911_class>
966 Returns a hashref of allowed values and descriptions for the C<e911_type>
972 tie my %x, 'Tie::IxHash', (
975 3 => 'Residence PBX',
978 6 => 'Coin 1 Way out',
981 9 => 'Residence OPX',
983 A => 'Customer Operated Coin Telephone',
985 G => 'Wireless Phase I',
986 H => 'Wireless Phase II',
987 I => 'Wireless Phase II with Phase I information',
988 V => 'VoIP Services Default',
989 C => 'VoIP Residence',
990 D => 'VoIP Business',
991 E => 'VoIP Coin/Pay Phone',
992 F => 'VoIP Wireless',
994 K => 'VoIP Enterprise Services',
1001 tie my %x, 'Tie::IxHash', (
1002 0 => 'Not FX nor Non-Published',
1003 1 => 'FX in 911 serving area',
1004 2 => 'FX outside 911 serving area',
1005 3 => 'Non-Published',
1006 4 => 'Non-Published FX in serving area',
1007 5 => 'Non-Published FX outside serving area',
1008 6 => 'Local Ported Number',
1009 7 => 'Interim Ported Number',
1020 L<FS::svc_Common>, L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>,
1021 L<FS::cust_pkg>, schema.html from the base documentation.