diff --git a/CHANGELOG.md b/CHANGELOG.md index 6145f758..1919497b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## [4.52.0](https://github.com/plivo/plivo-php/tree/v4.52.0) (2023-06-30) +**Feature - CNAM Storage** +- Added New Param `cnam` in to the response of the [list all numbers API], [list single number API] +- Added `cnam` filter to AccountPhoneNumber - list all my numbers API. +- Added `cnam`, `callback_url`, `callback_method` parameter to buy number[Buy a Phone Number] to configure CNAM storage while buying a US number +- Added `cnam`, `callback_url`, `callback_method` parameter to update number[Update an account phone number] to configure CNAM storage while updating a US number + ## [v4.51.0](https://github.com/plivo/plivo-php/tree/v4.51.0) (2023-06-28) **Audio Streaming** - API support for starting, deleting, getting streams on a live call diff --git a/src/Plivo/Resources/Number/Number.php b/src/Plivo/Resources/Number/Number.php index c26ae4ab..44061d0c 100644 --- a/src/Plivo/Resources/Number/Number.php +++ b/src/Plivo/Resources/Number/Number.php @@ -76,6 +76,7 @@ function __construct(BaseClient $client, array $response, $authId) 'tollFreeSMSVerification' => $response['toll_free_sms_verification'], 'renewalDate' => $response['renewal_date'], 'cnamLookup' => isset($response['cnam_lookup']) ? $response['cnam_lookup'] : null, + 'cnam' => isset($response['cnam']) ? $response['cnam'] : null, ]; if (isset($response['object_id'])) { $this->properties['objectId'] = $response['object_id']; diff --git a/src/Plivo/Resources/Number/NumberInterface.php b/src/Plivo/Resources/Number/NumberInterface.php index 6811d062..b7c5e3fa 100644 --- a/src/Plivo/Resources/Number/NumberInterface.php +++ b/src/Plivo/Resources/Number/NumberInterface.php @@ -49,6 +49,7 @@ function __construct(BaseClient $plivoClient, $authId) * + [int] limit - Used to display the number of results per page. The maximum number of results that can be fetched is 20. * + [int] offset - Denotes the number of value items by which the results should be offset. Eg:- If the result contains a 1000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results. * + [string] cnam_lookup - Used to filter on the basis of this param. If this parameter is included in the request, all numbers of the particular cnam lookup are displayed. + * + [string] cnam - Used to filter on the basis of this param. If this parameter is included in the request, all numbers having particular cnam storage are displayed. * + [string] renewal_date - Used to filter on the basis of this param. If this parameter is included in the request, all numbers of the particular renewal date are displayed. * + [string] renewal_date__gt - Used to filter on the basis of this param. If this parameter is included in the request, all numbers greater than renewal date are displayed. * + [string] renewal_date__gte - Used to filter on the basis of this param. If this parameter is included in the request, all numbers greater than equal renewal date are displayed. @@ -134,6 +135,8 @@ public function get($number) * + [string] app_id - The application id of the application that is to be linked. * + [string] subaccount - The auth_id of the subaccount to which this number should be added. This can only be performed by a main account holder. * + [string] cnam_lookup - The cnam lookup value for the number (Valid values : enabled, disabled). + * + [string] cnam - The cnam storage value for the number (Valid values : as per cnam validity in api). + * @return ResponseUpdate */ public function update($number, $optionalArgs = []) diff --git a/src/Plivo/Resources/PhoneNumber/PhoneNumberInterface.php b/src/Plivo/Resources/PhoneNumber/PhoneNumberInterface.php index 930d70cc..a000d009 100644 --- a/src/Plivo/Resources/PhoneNumber/PhoneNumberInterface.php +++ b/src/Plivo/Resources/PhoneNumber/PhoneNumberInterface.php @@ -92,11 +92,11 @@ public function getList($countryIso, $optionalArgs = []) * @param string|null $cnamLookup * @return PhoneNumberBuyResponse output */ - public function buy($phoneNumber, $appId = null, $cnamLookup = null) + public function buy($phoneNumber, $appId = null, $cnamLookup = null, $cnam = null) { $response = $this->client->update( $this->uri . $phoneNumber . '/', - ['app_id'=>$appId,'cnam_lookup'=>$cnamLookup] + ['app_id'=>$appId,'cnam_lookup'=>$cnamLookup, 'cnam'=>$cnam] ); $responseContents = $response->getContent(); diff --git a/src/Plivo/Version.php b/src/Plivo/Version.php index b6906849..38ae7a1f 100644 --- a/src/Plivo/Version.php +++ b/src/Plivo/Version.php @@ -20,7 +20,7 @@ class Version /** * @const int PHP helper library minor version number */ - const MINOR = 51; + const MINOR = 52; /** * @const int PHP helper library patch number diff --git a/tests/Mocks/numberGetResponse.json b/tests/Mocks/numberGetResponse.json index fa632667..a68e0999 100644 --- a/tests/Mocks/numberGetResponse.json +++ b/tests/Mocks/numberGetResponse.json @@ -20,6 +20,7 @@ "mms_enabled": true, "mms_rate": "0.00750", "cnam_lookup": "enabled", + "cnam": "plivo", "compliance_application_id": "20372631212782797", "compliance_status": "submitted", "renewal_date": "2014-03-14", diff --git a/tests/Mocks/numberListResponse.json b/tests/Mocks/numberListResponse.json index 257eb24f..fbcd36bb 100644 --- a/tests/Mocks/numberListResponse.json +++ b/tests/Mocks/numberListResponse.json @@ -29,6 +29,7 @@ "mms_enabled": true, "mms_rate": "0.00950", "cnam_lookup": "enabled", + "cnam": "numbers", "compliance_application_id": "20372631212782797", "compliance_status": "submitted", "renewal_date": "2014-09-05", @@ -59,6 +60,7 @@ "mms_enabled": true, "mms_rate": "0.00750", "cnam_lookup": "enabled", + "cnam": "plivonum", "compliance_application_id": "20372631212782797", "compliance_status": "submitted", "renewal_date": "2013-02-01", @@ -89,6 +91,7 @@ "mms_enabled": true, "mms_rate": "0.00850", "cnam_lookup": "disabled", + "cnam": "plivo", "compliance_application_id": "20372631212782799", "compliance_status": "submitted", "renewal_date": "2013-04-25",