Vonage / vonage-php-code-snippets

PHP code examples for using Vonage APIs
MIT License
29 stars 56 forks source link

Added example to update existing call with an NCCO #38

Closed dragonmantank closed 4 years ago

dragonmantank commented 4 years ago

This shows how to update an existing call with an NCCO transfer, instead of using the \Nexmo\Call\Transfer class.

This also has some cleanup on the naming used for the application key and private key path, the .env-example file does not match what we really use.

This also introduces a few conventions I want to start using during the code snippet cleanup.

  1. Use of $argv instead of relying on transient defines. Turns out it's really easy to disable inline environment variables in PHP
  2. Using error_log() whenever an error happens, to get proper stderr output. Previously it and echo were used interchangeably.
  3. Proper exit codes (PHP naturally exits with 0, so only need to explicitly exit() when there is an error).