{"id":22085643,"url":"https://github.com/nexmo/voice-event-logger","last_synced_at":"2025-03-23T22:16:12.466Z","repository":{"id":66173070,"uuid":"162990950","full_name":"Nexmo/voice-event-logger","owner":"Nexmo","description":"A helper application to help debug voice call events, with a choice of log destinations. Based on PHP, Slim Framework and Monolog.","archived":false,"fork":false,"pushed_at":"2021-02-02T13:32:55.000Z","size":15,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-01-29T05:25:04.672Z","etag":null,"topics":["debugging","developer","nexmo"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nexmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-24T12:58:53.000Z","updated_at":"2020-11-16T14:19:45.000Z","dependencies_parsed_at":"2023-02-20T23:15:25.909Z","dependency_job_id":null,"html_url":"https://github.com/Nexmo/voice-event-logger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fvoice-event-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fvoice-event-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fvoice-event-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fvoice-event-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nexmo","download_url":"https://codeload.github.com/Nexmo/voice-event-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245175480,"owners_count":20572787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging","developer","nexmo"],"created_at":"2024-12-01T01:15:41.162Z","updated_at":"2025-03-23T22:16:12.443Z","avatar_url":"https://github.com/Nexmo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nexmo Voice Event Debugger\n\nThis tool is intended as a diagnostic tool to assist during the development phase of software projects. If you are working with the Nexmo voice applications, you can use this project to give you a simple `event_url` endpoint to send your webhooks to, and inspect what is received.\n\nIf you're new to Nexmo, you can sign up here: \u003chttps://dashboard.nexmo.com\u003e and learn how to create a voice application over here: \u003chttps://developer.nexmo.com/voice/voice-api/overview#getting-started\u003e\n\n\u003e Note that this is intended for development use only. This isn't just a disclaimer: this is a debugging tool and it really, really won't work at scale.\n\nJump straight to:\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Notes](#notes)\n* [Contributing](#contributing)\n\n## Installation\n\nThis application can be used in a choice of ways:\n\n* Deployed to Heroku with the \"deploy to heroku\" button - [see docs](#install-with-heroku)\n* Deployed to Heroku manually - [see docs](#manual-heroku-install)\n* Run locally with [Ngrok](https://ngrok.com/) - [see docs](#run-locally)\n\nEach of these options is covered in its own section below:\n\n### Install with Heroku\n\nClick this button: [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\n### Manual Heroku Install\n\n**Step 0:** Clone this repository to your own machine.\n\n**Step 1:** Create Heroku application\n\nYou will need the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) to complete this section.\n\nFrom the root directory of the cloned project, create the application:\n\n```\nheroku create\n```\n\nThis will show you the application name and URL: copy the _name_ now as we need it in the next step\n\n**Step 2:** Configure AddOns (optional)\n\n\u003e If you want to be able to view the event logs, then run this step to add the `heroku-redis` AddOn to your project. This is free but does require a credit card to be registered on the account. Without Redis and without making further changes (it's an easy project to extend) the application will write to the PHP error_log and you will only be able to view the output by checking your application logs (which might be enough, depending on your needs).\n\nAdd the Redis AddOn:\n\n```\nheroku addons:create heroku-redis:hobby-dev -a [paste application name here]\n```\n\n**Step 3:** Deploy the application\n\nPush the code up to the Heroku application you created:\n\n```\ngit push heroku master\n```\n\n**Step 4:** Check the installation\n\nNow copy the application URL and visit it: you should see a message about there not being any records to display. That's fine!\n\nWhen you configure your Nexmo voice application, the `event_url` should be set to `https://wonderful-heroku-app-naming.herokuapp.com/event` (replace as appropriate).\n\n### Run locally\n\n**Step 0:** Clone this repository to your own machine.\n\nThis project runs on PHP, it's been tested with PHP 7.1 and later. It can write to your error log, a local file, or Redis (we won't cover how to install Redis in this guide). You will need a current, stable version of [PHP](https://php.net) and [Composer](https://getcomposer.org).\n\n**Step 1:** Install the dependencies\n\n```\ncomposer install\n```\n\n**Step 2:** Configure the application\n\nYou will need to copy `.env-example` to `.env` and edit appropriately:\n\n* If `REDIS_URL` is set, this application will log incoming events to Redis. Each event becomes an entry in a list called \"logs\".\n* If `LOG_FILE` is set, this application will write one new line to the end of this file for each incoming event.\n* If both values are set, both locations will be written to. Check `config.php` to see where the Monolog setup happens and adapt/extend to meet your needs.\n* If neither is set, you can leave the `.env` file empty (but it needs to exist) and the application will fall back to writing events to PHP's error log.\n\n**Step 3:** Start the webserver.\n\nFrom the `public/` directory, run this command to start the built-in webserver:\n\n```\nphp -S localhost:8080\n```\n\nYou can change the port number to suit your needs.\n\n**Step 4:** Verify that everything works as expected.\n\nVisit \u003chttp://localhost:8080\u003e and you should see a message about not having any data. That's fine, we're ready to go!\n\n**Step 5:** Set up Ngrok to allow Nexmo to access your application\n\nIf you're running the code locally, the code won't be available to the wider 'net. Since Nexmo needs to be able to make a web request to this code, we can use [Ngrok](https://ngrok.com) to create a secure tunnel to the outside world. Check the [Ngrok installation instructions](https://ngrok.com/download) if you don't already have it set up (it's easy, I promise).\n\nOnce you have the application running, start an ngrok tunnel with a command like this:\n\n```\nngrok http 8080\n```\n\nYou will see a dashboard including some \"Forwarding URL\" fields - copy the https one, which will look something like: `https://abcd1234.ngrok.io`. If you make a web request to that endpoint, you will see the request appear in the window where you ran the command.\n\nAlso now visit \u003chttp://localhost:4040\u003e which is the powerful and excellent dashboard of Ngrok - from here you can see exactly the request that arrived, what your application returned, and replay requests if you want to.\n\n\u003e Note that each time you start Ngrok, you will get a new URL and will need to update your Nexmo application with the new URL. Alternatively, consider paying for an Ngrok account since this allows you to have named tunnels that you can use every time.\n\nWhen you configure your Nexmo voice application, the `event_url` will be (replace your actual Ngrok tunnel name): `https://abcd1234.ngrok.io/event`\n\n## Usage\n\nWhen setting up your Nexmo voice application, set the `event_url` to be the URL of where you installed this project, with `/event` appended. F\n\n## Notes\n\nThis project uses PHP, Slim Framework and Monolog; these are all very standard components that you can extend, replace or generally should be very maintainable. By default this application writes event information to the error log of the PHP application: support for files and Redis is also included - but with Monolog you can configure any handler you'd like so please do feel free to go ahead and extend this to meet your needs.\n\n## Contributing\n\nWe welcome issues, suggestions and pull requests. If there's something you have added for your own use, feel free to share it widely with other users of this project!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo%2Fvoice-event-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexmo%2Fvoice-event-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo%2Fvoice-event-logger/lists"}