Skip to content

Fix #52 - cast 'NUMBER_SEARCH_CRITERIA' as (string). #60

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

Open
wants to merge 6 commits into
base: main
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
4 changes: 3 additions & 1 deletion .env-example
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
VONAGE_API_KEY=
VONAGE_API_SECRET=
VONAGE_APPLICATION_ID=
VONAGE_API_SIGNATURE_SECRET=
VONAGE_APPLICATION_ID=12a3b4cd-a1b2-1ab2-a1b2-a1234bc5d678
VONAGE_APPLICATION_PRIVATE_KEY_PATH=
FROM=
VONAGE_TO_NUMBER=
RECIPIENT_NUMBER=
FROM_NUMBER=
TO_NUMBER=
VONAGE_SECRET_ID=
INSIGHT_NUMBER=
Expand Down
6 changes: 5 additions & 1 deletion numbers/search-available.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
$client = new \Vonage\Client($basic);

/** @var IterableAPICollection $response */
/** Note: be careful when specifying "NUMBER_SEARCH_CRITERIA" environment variable:
* surround it with quotes if it has a leading zero, otherwise the (string) conversion
* will assume it is an Octal number and convert it. e.g., (string)0123 results in "83".
*/
$filter = new AvailableNumbers([
"pattern" => (int) NUMBER_SEARCH_CRITERIA,
"pattern" => (string)NUMBER_SEARCH_CRITERIA,
"search_pattern" => (int) NUMBER_SEARCH_PATTERN,
"type" => VONAGE_NUMBER_TYPE,
"features" => VONAGE_NUMBER_FEATURES,
Expand Down