Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cnam storage php sdk #322

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Plivo/Resources/Number/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
3 changes: 3 additions & 0 deletions src/Plivo/Resources/Number/NumberInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 = [])
Expand Down
4 changes: 2 additions & 2 deletions src/Plivo/Resources/PhoneNumber/PhoneNumberInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/Plivo/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/Mocks/numberGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions tests/Mocks/numberListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down