1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace libphonenumber; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Type of phone numbers. |
7
|
|
|
*/ |
8
|
|
|
class PhoneNumberType |
9
|
|
|
{ |
10
|
|
|
const FIXED_LINE = 0; |
11
|
|
|
const MOBILE = 1; |
12
|
|
|
// In some regions (e.g. the USA), it is impossible to distinguish between fixed-line and |
13
|
|
|
// mobile numbers by looking at the phone number itself. |
14
|
|
|
const FIXED_LINE_OR_MOBILE = 2; |
15
|
|
|
// Freephone lines |
16
|
|
|
const TOLL_FREE = 3; |
17
|
|
|
const PREMIUM_RATE = 4; |
18
|
|
|
// The cost of this call is shared between the caller and the recipient, and is hence typically |
19
|
|
|
// less than PREMIUM_RATE calls. See // http://en.wikipedia.org/wiki/Shared_Cost_Service for |
20
|
|
|
// more information. |
21
|
|
|
const SHARED_COST = 5; |
22
|
|
|
// Voice over IP numbers. This includes TSoIP (Telephony Service over IP). |
23
|
|
|
const VOIP = 6; |
24
|
|
|
// A personal number is associated with a particular person, and may be routed to either a |
25
|
|
|
// MOBILE or FIXED_LINE number. Some more information can be found here: |
26
|
|
|
// http://en.wikipedia.org/wiki/Personal_Numbers |
27
|
|
|
const PERSONAL_NUMBER = 7; |
28
|
|
|
const PAGER = 8; |
29
|
|
|
// Used for "Universal Access Numbers" or "Company Numbers". They may be further routed to |
30
|
|
|
// specific offices, but allow one number to be used for a company. |
31
|
|
|
const UAN = 9; |
32
|
|
|
// A phone number is of type UNKNOWN when it does not fit any of the known patterns for a |
33
|
|
|
// specific region. |
34
|
|
|
const UNKNOWN = 10; |
35
|
|
|
|
36
|
|
|
// Emergency |
37
|
|
|
const EMERGENCY = 27; |
38
|
|
|
|
39
|
|
|
// Voicemail |
40
|
|
|
const VOICEMAIL = 28; |
41
|
|
|
|
42
|
|
|
// Short Code |
43
|
|
|
const SHORT_CODE = 29; |
44
|
|
|
|
45
|
|
|
// Standard Rate |
46
|
|
|
const STANDARD_RATE = 30; |
47
|
|
|
|
48
|
2 |
|
public static function values() |
49
|
|
|
{ |
50
|
|
|
return array( |
51
|
2 |
|
self::FIXED_LINE => 'FIXED_LINE', |
52
|
2 |
|
self::MOBILE => 'MOBILE', |
53
|
2 |
|
self::FIXED_LINE_OR_MOBILE => 'FIXED_LINE_OR_MOBILE', |
54
|
2 |
|
self::TOLL_FREE => 'TOLL_FREE', |
55
|
2 |
|
self::PREMIUM_RATE => 'PREMIUM_RATE', |
56
|
2 |
|
self::SHARED_COST => 'SHARED_COST', |
57
|
2 |
|
self::VOIP => 'VOIP', |
58
|
2 |
|
self::PERSONAL_NUMBER => 'PERSONAL_NUMBER', |
59
|
2 |
|
self::PAGER => 'PAGER', |
60
|
2 |
|
self::UAN => 'UAN', |
61
|
2 |
|
self::UNKNOWN => 'UNKNOWN', |
62
|
2 |
|
self::EMERGENCY => 'EMERGENCY', |
63
|
2 |
|
self::VOICEMAIL => 'VOICEMAIL', |
64
|
2 |
|
self::SHORT_CODE => 'SHORT_CODE', |
65
|
2 |
|
self::STANDARD_RATE => 'STANDARD_RATE', |
66
|
|
|
); |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|