Skip to content

Fix issue #51: add environment variable placeholders for FROM_NUMBER … #59

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 3 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
2 changes: 2 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
VONAGE_API_KEY=
VONAGE_API_SECRET=
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
11 changes: 10 additions & 1 deletion numbers/search-available.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@
$client = new \Vonage\Client($basic);

/** @var IterableAPICollection $response */
/** Note: be careful when specifying "NUMBER_SEARCH_CRITERIA" environment variable:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we revert the changes made in this file and handle it all in #60 ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid I have made a monumental mess of these pull requests.
Do you want to just close these two and I will create a new pull request with a single, merged commit that has fixes for both Issue #51 and Issue #52? I will merge them into my forked master branch as a squash commit and then create a pull request for you. How does that sound? Thank you for being patient.

* 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".
* NUMBER_SEARCH_PATTERN will be one of 0 (search for numbers that start with pattern);
* 1 (search for numbers that contain pattern), or 2 (search for numbers that end with pattern).
* VONAGE_NUMBER_TYPE must be one of: landline, mobile-lvn or landline-toll-free
* VONAGE_NUMBER_FEATURES Must be one of: SMS, VOICE, SMS,VOICE, MMS, SMS,MMS, VOICE,MMS
* or SMS,MMS,VOICE
*/
$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