{"id":22085676,"url":"https://github.com/nexmo/800-replacement","last_synced_at":"2025-03-23T22:16:30.438Z","repository":{"id":66173021,"uuid":"94866847","full_name":"Nexmo/800-replacement","owner":"Nexmo","description":"Replace toll-free 800 numbers with multiple local numbers","archived":false,"fork":false,"pushed_at":"2021-02-02T13:27:56.000Z","size":4,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-01-29T05:25:14.712Z","etag":null,"topics":["tutorial"],"latest_commit_sha":null,"homepage":"https://developer.nexmo.com/tutorials/smart-local-numbers","language":"Ruby","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":"2017-06-20T08:16:52.000Z","updated_at":"2023-03-08T15:22:55.000Z","dependencies_parsed_at":"2023-02-21T05:16:01.082Z","dependency_job_id":null,"html_url":"https://github.com/Nexmo/800-replacement","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%2F800-replacement","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2F800-replacement/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2F800-replacement/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2F800-replacement/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nexmo","download_url":"https://codeload.github.com/Nexmo/800-replacement/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245175482,"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":["tutorial"],"created_at":"2024-12-01T01:15:54.804Z","updated_at":"2025-03-23T22:16:30.432Z","avatar_url":"https://github.com/Nexmo.png","language":"Ruby","readme":"# Replace toll-free 800 numbers with multiple local numbers\n\nThis app used the Nexmo Voice APIs to demonstrate the power of using multiple local numbers instead of a toll-free generic number.\n\n## Prerequisites\n\nYou will need:\n\n* A [free Nexmo account](https://dashboard.nexmo.com/sign-up)\n* The [Nexmo CLI](https://github.com/Nexmo/nexmo-cli) installed\n* A way to run a local server on a public port, for example [Ngrok](https://ngrok.com/).\n* [Ruby 2.1+](https://www.ruby-lang.org/) and [Bundler](http://bundler.io/)\n\n\n## Installation\n\n```sh\n# clone this repository\ngit clone git@github.com:Nexmo/ruby-800-replacement.git\n# change to folder\ncd ruby-800-replacement\n# install dependencies\nbundle install\n# create a .env\ncp .env.example .env\n```\n\n## Setup\n\n### Buy Numbers \u0026 Create Application\n\nTo run this application we need to buy 2 numbers, set up an application, and tie the numbers to this application.\n\n```sh\n# create an application\n\u003e nexmo app:create \"800 Replacement\" http://your.domain/answer http://your.domain/event --type voice --keyfile app.key\n# check the application ID\n\u003e nexmo app:list\n12345678-1234-1234-1234-1234567890 | 800 Replacement\n# purchase 2 numbers in different regions\n# For example, Chicago\n\u003e nexmo number:buy 1312* -c US  --confirm\nNumber purchased: 13125550000\n# And San Francisco\n\u003e nexmo number:buy 1415* -c US  --confirm\nNumber purchased: 14155550000\n# link the numbers to the application ID\n\u003e nexmo link:app 13125550000 12345678-1234-1234-1234-1234567890\n\u003e nexmo link:app 14155550000 12345678-1234-1234-1234-1234567890\n```\n\n### Run Server\n\nThe next step is to set up all of our variables in a `.env` file. You can start off by copying the example file.\n\n```sh\nmv .env.example .env\n```\n\nFill in the values in `.env` as appropriate, where `INBOUND_NUMBER_1` and `INBOUND_NUMBER_2` are the numbers you just purchased). Finally, `DOMAIN` is the public domain or hostname your server is available on (including scheme).\n\nWith this in place you can start the server.\n\n```sh\nruby app.rb\n```\n\nThe application should be available on \u003chttp://localhost:4567\u003e. For this to work full though, make sure to expose your server on a public domain (e.g. `your.domain` in the example above) using a tool like [Ngrok](https://ngrok.com/).\n\n## Using the App\n\nWith your server running, call either of the 2 numbers you purchased. Nexmo will then make a call to `http://your.domain/answer` which plays back a message for the local transit system for the city you just called a local number for. It then allows you to play back the messages for the other cities after a prompt.\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo%2F800-replacement","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexmo%2F800-replacement","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo%2F800-replacement/lists"}