Freeside:3:Documentation:Developer/FS/svc phone
From Freeside
< Freeside:3:Documentation:Developer | FS
Revision as of 05:42, 10 February 2015 by Jeremyd (talk | contribs) (Edit via perl MediaWiki framework (1.13))
NAME
FS::svc_phone - Object methods for svc_phone records
SYNOPSIS
use FS::svc_phone; $record = new FS::svc_phone \%hash; $record = new FS::svc_phone { 'column' => 'value' }; $error = $record->insert; $error = $new_record->replace($old_record); $error = $record->delete; $error = $record->check; $error = $record->suspend; $error = $record->unsuspend; $error = $record->cancel;
DESCRIPTION
An FS::svc_phone object represents a phone number. FS::svc_phone inherits from FS::Record. The following fields are currently supported:
- svcnum
- primary key
- countrycode; phonenum; sim_imsi
- SIM IMSI (http://en.wikipedia.org/wiki/International_mobile_subscriber_identity)
- sip_password; pin
- Voicemail PIN
- phone_name; pbxsvc
- Optional svcnum from svc_pbx
- forwarddst
- Forwarding destination
- Email address for virtual fax (fax-to-email) services
- lnp_status
- LNP Status (can be null, native, portedin, portingin, portin-reject, portingout, portout-reject)
- portable; lrn; lnp_desired_due_date; lnp_due_date; lnp_other_provider
- If porting the number in or out, name of the losing or winning provider, respectively.
- lnp_other_provider_account
- Account number of other provider. See lnp_other_provider.
- lnp_reject_reason
- See lnp_status. If lnp_status is portin-reject or portout-reject, this is an optional reject reason.
- e911_class
- Class of Service for E911 service (per the NENA 2.1 standard).
- e911_type
- Type of Service for E911 service.
- circuit_svcnum
- The FS::svc_circuit record for the physical circuit that transports this phone line.
- sip_server
- The hostname of the SIP server that this phone number is routed to.
METHODS
- new HASHREF
- Creates a new phone number. To add the number to the database, see "insert".
- Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
- search_sql STRING
- Class method which returns an SQL fragment to search for the given string.
- label
- Returns the phone number.
- insert
- Adds this phone number to the database. If there is an error, returns the error, otherwise returns false.
- delete
- Delete this record from the database.
- replace OLD_RECORD
- Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
- suspend
- Called by the suspend method of FS::cust_pkg (see FS::cust_pkg).
- unsuspend
- Called by the unsuspend method of FS::cust_pkg (see FS::cust_pkg).
- cancel
- Called by the cancel method of FS::cust_pkg (see FS::cust_pkg).
- check
- Checks all fields to make sure this is a valid phone number. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
- _check duplicate
- Internal method to check for duplicate phone numers.
- check_pin
- Checks the supplied PIN against the PIN in the database. Returns true for a sucessful authentication, false if no match.
- radius_reply; radius_check; sms_cdr_carrier
- Returns the FS::cdr_carrier assigned as the SMS carrier for this phone.
- sms_carriername
- Returns the name of the SMS carrier, or an empty string if there isn't one.
- svc_circuit
- Returns the FS::svc_circuit assigned as the trunk for this phone line.
- circuit_label
- Returns the label of the circuit (the part_svc label followed by the circuit ID), or an empty string if there isn't one.
- phone_device
- Returns any FS::phone_device records associated with this service.
- phone_name_or_cust
- Returns the phone_name field if it has a value, or the package contact name if there is one, or the customer contact name.
- psearch_cdrs OPTIONS
- Returns a paged search (FS::PagedSearch) for Call Detail Records associated with this service. By default, "associated with" means that either the "src" or the "charged_party" field of the CDR matches the "phonenum" field of the service. To access the CDRs themselves, call "->fetch" on the resulting object.
- Accepts the following options:
- for_update => 1: SELECT the CDRs "FOR UPDATE".
- status => "" (or "processing-tiered", "done"): Return only CDRs with that processing status.
- inbound => 1: Return CDRs for inbound calls (that is, those that match on 'dst'). With "status", will filter on inbound processing status.
- default_prefix => "XXX": Also accept the phone number of the service prepended with the chosen prefix.
- begin, end: Start and end of a date range, as unix timestamp.
- cdrtypenum: Only return CDRs with this type.
- calltypenum: Only return CDRs with this call type.
- disable_src => 1: Only match on 'charged_party', not 'src'.
- disable_charged_party => 1: Only match on 'src', not 'charged_party'.
- nonzero: Only return CDRs where duration > 0.
- by_svcnum: not supported for svc_phone
- billsec_sum: Instead of returning all of the CDRs, return a single record (as an FS::cdr object) with the sum of the 'billsec' field over the entire result set.
- get_cdrs (DEPRECATED)
- Like psearch_cdrs, but returns all the FS::cdr objects at once, in a single list. Arguments are the same as for psearch_cdrs. This can take an unreasonably large amount of memory and is best avoided.
- sum_cdrs
- Takes the same options as psearch_cdrs, but returns a single row containing "count" (the number of CDRs) and the sums of the following fields: duration, billsec, rated_price, rated_seconds, rated_minutes.
- Note that if any calls are not rated, their rated_* fields will be null. If you want to use those fields, pass the 'status' option to limit to calls that have been rated. This is intentional; please don't "fix" it.
CLASS METHODS
- e911_classes
- Returns a hashref of allowed values and descriptions for the e911_class field.
- e911_types
- Returns a hashref of allowed values and descriptions for the e911_type field.
BUGS
SEE ALSO
FS::svc_Common, FS::Record, FS::cust_svc, FS::part_svc, FS::cust_pkg, schema.html from the base documentation.
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
- Around line 831:
- You can't have =items (as at line 835) unless the first thing after the =over is an =item