VERSION
VERSION
The wrapper version.
The wrapper version number.
Telephone Numbers Web Service.
setWebServicesServer(string $wsserver)
Set the web services server address.
This allows the web service requests to be directed to a specific server. The default is https://ws-<cloud_id>.aculabcloud.net
string | $wsserver | The base URL of the web services server. |
setCryptoMethod(integer $method)
Set the crypto method used when connectiing to the web services server.
This allows a specific crypto method to be used when connecting to the web service server. The values should be one of the STREAM_CRYPTO_METHOD_TLSv1_N_CLIENT constants. The default is STREAM_CRYPTO_METHOD_ANY_CLIENT.
integer | $method | The crypto method to use. |
purchaseNumbers(\Aculab\WebServicesWrapper\NumberPurchaseRequest $number_purchase_request, boolean $development = False) : array
Purchase telephone numbers.
This purchases an inbound telephone numbers. Please note that this service results in an immediate and subsequent monthly cost, unless $development is true.
\Aculab\WebServicesWrapper\NumberPurchaseRequest | $number_purchase_request | Details the numbers to purchase. |
boolean | $development | Indicates if this request is for development testing. When true, this request does not result in a purchase and no cost is incurred. |
An array containing the numbers purchased.
listNumbers(string $country = null, string $state = null, string $region = null, string $did_type = null) : array
List purchased numbers.
This lists purchased telephone numbers. It can be filtered by location and type.
string | $country | The country where the number is located. |
string | $state | The state where the number is located. |
string | $region | The region where the number is located. This is a region name for geographic numbers or a number prefix for toll free, mobile or national numbers. |
string | $did_type | The type of numbers to include in the list. One of "geographic", "national", "mobile" or "tollfree". Default is to list all types. |
An array of NumberDetails objects, keyed by telephone number.
deleteNumbers(array|string $numbers) : array
Delete purchased numbers.
This deletes one or more of the purchased telephone numbers. The returned array only contains \Aculab\WebServicesWrapper\NumberDeleteError objects for the numbers that could not be deleted. If all specified numbers have been deleted the array is empty.
array|string | $numbers | The telephone number or an array of numbers to delete. |
An array of NumberDeleteError objects, keyed by telephone number.
getSupportedCountries(string $did_type = null) : array
Get supported countries.
This obtains a list of the countries for which telephone numbers can be purchased.
string | $did_type | The type of numbers supported by a country for that country to be listed. One of "geographic", "national", "mobile" or "tollfree". Default is "geographic". |
An array of countries.
getSupportedStates(string $country) : array
Get supported states.
This obtains a list of the states in a specified country for which telephone numbers can be purchased. Note that not all countries support states.
string | $country | The country in which to list the supported states. |
An array of states.
getSupportedRegions(string $country, string $state = null, string $did_type = null) : array
Get supported regions.
This obtains a list of the regions, or prefixes, in a specified country for which telephone numbers can be purchased.
string | $country | The country in which to list the supported regions. |
string | $state | The state in which to list the supported regions. Required for some countries. |
string | $did_type | The type of numbers supported by the region to be listed. One of "geographic", "national", "mobile" or "tollfree". Default is "geographic". |
An array of regions or prefixes.
getRegulationAddresses() : array
List regulation addresses.
This lists any regulation addresses that have been registered on a cloud account. Some countries require an address to be specified when purchasing a telephone number.
An array of RegulationAddressDetails, keyed by address name.